From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ra85551 at gmail.com Fri May 14 08:51:34 2010 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Fri, 14 May 2010 18:51:34 +0400 Subject: [Rxtx] problem with compiling RXTX for OpenWrt 10.03 host Message-ID: Hello, I try to compile RXTX for use on OpenWrt box. ./configure --host=mipsel-openwrt-linux --prefix=/home/pavel/rxtx2.2-bin make But I've been got a following error: mipsel-openwrt-linux-gcc -I/home/pavel/rxtx-2.2pre2 -Imipsel-openwrt-linux-gnu -I. -I/opt/java/include -I/opt/java/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/pavel/rxtx-2.2pre2/./src/RawImp.c -fPIC -DPIC -o /home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/.libs/RawImp.o /home/pavel/rxtx-2.2pre2/./src/RawImp.c:104:20: sys/io.h: No such file or directory libtool: link: `/home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/RawImp.lo' is not a valid libtool object I've found no better solution than comment out entire line 104 in src/RawImp.c 104c104 < //#include --- > #include After that compilation has been succeeded. But is this the best way to compile? -- Pavel Parkhomenko From davestechshop at gmail.com Fri May 14 13:08:58 2010 From: davestechshop at gmail.com (Dave) Date: Fri, 14 May 2010 15:08:58 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux Message-ID: Here is some non-technical feedback about rxtx on two platforms. (I'm not a developer.) We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, but it has one problem we can't overcome. Windows: -------------------- 2.2pre2 on Windows crashes when the connected device is turned off or unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. Linux: -------------------- The best way I can explain the 2.2.pre2 problem on Linux is to paste this: "Tell them the read on the inputstream doesn't block, and when you enable the receiveTimeout, it gets forgotten after the first bytes are received [and it cannot be re-asserted]." Workarounds: -------------------- A workaround for the problem is possible on Windows, but we haven't found one for Linux. Our code is doing something that is not done by the example code generous people on this list helped me with. Our code receives many serial input events over 24 hours without intentionally disconnecting. The receiveTimeout problem is only evident after the first data packet is complete and the connection remains open for some time. Furthermore, if the instrument is disconnected, our app needs to wait and reconnect when the instrument becomes available. rxtx 2.2pre2 will not do this (on Windows). However, 2.1.7 will handle the disconnect and recover. The biggest problem for us is 2.2pre2 on Linux because we haven't found any workaround yet. We can't go back to 2.1.7 on Linux either (because it apparently doesn't work). Wish I could say something that would be more meaningful to you guys (especially the devs), but I hope what I have said is of value to someone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 15 00:52:11 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 15 May 2010 08:52:11 +0200 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: 2010/5/14 Dave > Here is some non-technical feedback about rxtx on two platforms. (I'm not a > developer.) > > We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, > but it has one problem we can't overcome. > > Windows: > -------------------- > 2.2pre2 on Windows crashes when the connected device is turned off or > unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. > Hi Dave Sorry - I don't agree with above description - I have had more problems with 2.1.7... I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting USB dongle if I am using software construction shown in my previous examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. Everything is to safelly catch in Java and reconnect! There are several things more while working with system's suspend's as well. I have observed (mainly in W7) that small activity of the COM channel may results in VCP driver deactivation (or somethnig like that). Therefore I have prepared my external device to generate dummy data (SW software version) in declared time intervals. Problems has gone... In Vista there were enough to disable energy saving on USB ports in notebook - this problem wasn't observed on desktop. Regards Mariusz > Linux: > -------------------- > The best way I can explain the 2.2.pre2 problem on Linux is to paste this: > > "Tell them the read on the inputstream doesn't block, and when you enable > the receiveTimeout, it gets forgotten after the first bytes are received > [and it cannot be re-asserted]." > > Workarounds: > -------------------- > A workaround for the problem is possible on Windows, but we haven't found > one for Linux. > > Our code is doing something that is not done by the example code generous > people on this list helped me with. Our code receives many serial input > events over 24 hours without intentionally disconnecting. The receiveTimeout > problem is only evident after the first data packet is complete and the > connection remains open for some time. > > Furthermore, if the instrument is disconnected, our app needs to wait and > reconnect when the instrument becomes available. rxtx 2.2pre2 will not do > this (on Windows). However, 2.1.7 will handle the disconnect and recover. > > The biggest problem for us is 2.2pre2 on Linux because we haven't found any > workaround yet. We can't go back to 2.1.7 on Linux either (because it > apparently doesn't work). > > Wish I could say something that would be more meaningful to you guys > (especially the devs), but I hope what I have said is of value to someone. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Sat May 15 02:30:49 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 08:30:49 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 Message-ID: Hi, I just wanted to know why the parallel port dll for windows is missing in the pre2.2 binary package? Does anyone have it compiled and working? Thanks -- George H george.dma at gmail.com From george.dma at gmail.com Sat May 15 03:33:08 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 09:33:08 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 In-Reply-To: References: Message-ID: On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked?? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > From mariusz.dec at gmail.com Sat May 15 05:38:29 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 15 May 2010 13:38:29 +0200 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 References: Message-ID: <57E4C18871C249EC82846512B38F121D@mdam2> Hi, I have just compiled it, but my RXTX 2.2 pre hasn't last CVS's. Do you have any FTP? Many mail relay servers blocks mails with dll's. Regards Mariusz ----- Original Message ----- From: "George H" To: "rxtx" Sent: Saturday, May 15, 2010 11:33 AM Subject: Re: [Rxtx] ParallelPort dll missing for windows in pre2.2 On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ra85551 at gmail.com Fri May 14 08:51:34 2010 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Fri, 14 May 2010 18:51:34 +0400 Subject: [Rxtx] problem with compiling RXTX for OpenWrt 10.03 host Message-ID: Hello, I try to compile RXTX for use on OpenWrt box. ./configure --host=mipsel-openwrt-linux --prefix=/home/pavel/rxtx2.2-bin make But I've been got a following error: mipsel-openwrt-linux-gcc -I/home/pavel/rxtx-2.2pre2 -Imipsel-openwrt-linux-gnu -I. -I/opt/java/include -I/opt/java/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/pavel/rxtx-2.2pre2/./src/RawImp.c -fPIC -DPIC -o /home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/.libs/RawImp.o /home/pavel/rxtx-2.2pre2/./src/RawImp.c:104:20: sys/io.h: No such file or directory libtool: link: `/home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/RawImp.lo' is not a valid libtool object I've found no better solution than comment out entire line 104 in src/RawImp.c 104c104 < //#include --- > #include After that compilation has been succeeded. But is this the best way to compile? -- Pavel Parkhomenko From davestechshop at gmail.com Fri May 14 13:08:58 2010 From: davestechshop at gmail.com (Dave) Date: Fri, 14 May 2010 15:08:58 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux Message-ID: Here is some non-technical feedback about rxtx on two platforms. (I'm not a developer.) We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, but it has one problem we can't overcome. Windows: -------------------- 2.2pre2 on Windows crashes when the connected device is turned off or unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. Linux: -------------------- The best way I can explain the 2.2.pre2 problem on Linux is to paste this: "Tell them the read on the inputstream doesn't block, and when you enable the receiveTimeout, it gets forgotten after the first bytes are received [and it cannot be re-asserted]." Workarounds: -------------------- A workaround for the problem is possible on Windows, but we haven't found one for Linux. Our code is doing something that is not done by the example code generous people on this list helped me with. Our code receives many serial input events over 24 hours without intentionally disconnecting. The receiveTimeout problem is only evident after the first data packet is complete and the connection remains open for some time. Furthermore, if the instrument is disconnected, our app needs to wait and reconnect when the instrument becomes available. rxtx 2.2pre2 will not do this (on Windows). However, 2.1.7 will handle the disconnect and recover. The biggest problem for us is 2.2pre2 on Linux because we haven't found any workaround yet. We can't go back to 2.1.7 on Linux either (because it apparently doesn't work). Wish I could say something that would be more meaningful to you guys (especially the devs), but I hope what I have said is of value to someone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 15 00:52:11 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 15 May 2010 08:52:11 +0200 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: 2010/5/14 Dave > Here is some non-technical feedback about rxtx on two platforms. (I'm not a > developer.) > > We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, > but it has one problem we can't overcome. > > Windows: > -------------------- > 2.2pre2 on Windows crashes when the connected device is turned off or > unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. > Hi Dave Sorry - I don't agree with above description - I have had more problems with 2.1.7... I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting USB dongle if I am using software construction shown in my previous examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. Everything is to safelly catch in Java and reconnect! There are several things more while working with system's suspend's as well. I have observed (mainly in W7) that small activity of the COM channel may results in VCP driver deactivation (or somethnig like that). Therefore I have prepared my external device to generate dummy data (SW software version) in declared time intervals. Problems has gone... In Vista there were enough to disable energy saving on USB ports in notebook - this problem wasn't observed on desktop. Regards Mariusz > Linux: > -------------------- > The best way I can explain the 2.2.pre2 problem on Linux is to paste this: > > "Tell them the read on the inputstream doesn't block, and when you enable > the receiveTimeout, it gets forgotten after the first bytes are received > [and it cannot be re-asserted]." > > Workarounds: > -------------------- > A workaround for the problem is possible on Windows, but we haven't found > one for Linux. > > Our code is doing something that is not done by the example code generous > people on this list helped me with. Our code receives many serial input > events over 24 hours without intentionally disconnecting. The receiveTimeout > problem is only evident after the first data packet is complete and the > connection remains open for some time. > > Furthermore, if the instrument is disconnected, our app needs to wait and > reconnect when the instrument becomes available. rxtx 2.2pre2 will not do > this (on Windows). However, 2.1.7 will handle the disconnect and recover. > > The biggest problem for us is 2.2pre2 on Linux because we haven't found any > workaround yet. We can't go back to 2.1.7 on Linux either (because it > apparently doesn't work). > > Wish I could say something that would be more meaningful to you guys > (especially the devs), but I hope what I have said is of value to someone. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Sat May 15 02:30:49 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 08:30:49 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 Message-ID: Hi, I just wanted to know why the parallel port dll for windows is missing in the pre2.2 binary package? Does anyone have it compiled and working? Thanks -- George H george.dma at gmail.com From george.dma at gmail.com Sat May 15 03:33:08 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 09:33:08 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 In-Reply-To: References: Message-ID: On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked?? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > From mariusz.dec at gmail.com Sat May 15 05:38:29 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 15 May 2010 13:38:29 +0200 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 References: Message-ID: <57E4C18871C249EC82846512B38F121D@mdam2> Hi, I have just compiled it, but my RXTX 2.2 pre hasn't last CVS's. Do you have any FTP? Many mail relay servers blocks mails with dll's. Regards Mariusz ----- Original Message ----- From: "George H" To: "rxtx" Sent: Saturday, May 15, 2010 11:33 AM Subject: Re: [Rxtx] ParallelPort dll missing for windows in pre2.2 On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ra85551 at gmail.com Fri May 14 08:51:34 2010 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Fri, 14 May 2010 18:51:34 +0400 Subject: [Rxtx] problem with compiling RXTX for OpenWrt 10.03 host Message-ID: Hello, I try to compile RXTX for use on OpenWrt box. ./configure --host=mipsel-openwrt-linux --prefix=/home/pavel/rxtx2.2-bin make But I've been got a following error: mipsel-openwrt-linux-gcc -I/home/pavel/rxtx-2.2pre2 -Imipsel-openwrt-linux-gnu -I. -I/opt/java/include -I/opt/java/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/pavel/rxtx-2.2pre2/./src/RawImp.c -fPIC -DPIC -o /home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/.libs/RawImp.o /home/pavel/rxtx-2.2pre2/./src/RawImp.c:104:20: sys/io.h: No such file or directory libtool: link: `/home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/RawImp.lo' is not a valid libtool object I've found no better solution than comment out entire line 104 in src/RawImp.c 104c104 < //#include --- > #include After that compilation has been succeeded. But is this the best way to compile? -- Pavel Parkhomenko From davestechshop at gmail.com Fri May 14 13:08:58 2010 From: davestechshop at gmail.com (Dave) Date: Fri, 14 May 2010 15:08:58 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux Message-ID: Here is some non-technical feedback about rxtx on two platforms. (I'm not a developer.) We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, but it has one problem we can't overcome. Windows: -------------------- 2.2pre2 on Windows crashes when the connected device is turned off or unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. Linux: -------------------- The best way I can explain the 2.2.pre2 problem on Linux is to paste this: "Tell them the read on the inputstream doesn't block, and when you enable the receiveTimeout, it gets forgotten after the first bytes are received [and it cannot be re-asserted]." Workarounds: -------------------- A workaround for the problem is possible on Windows, but we haven't found one for Linux. Our code is doing something that is not done by the example code generous people on this list helped me with. Our code receives many serial input events over 24 hours without intentionally disconnecting. The receiveTimeout problem is only evident after the first data packet is complete and the connection remains open for some time. Furthermore, if the instrument is disconnected, our app needs to wait and reconnect when the instrument becomes available. rxtx 2.2pre2 will not do this (on Windows). However, 2.1.7 will handle the disconnect and recover. The biggest problem for us is 2.2pre2 on Linux because we haven't found any workaround yet. We can't go back to 2.1.7 on Linux either (because it apparently doesn't work). Wish I could say something that would be more meaningful to you guys (especially the devs), but I hope what I have said is of value to someone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 15 00:52:11 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 15 May 2010 08:52:11 +0200 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: 2010/5/14 Dave > Here is some non-technical feedback about rxtx on two platforms. (I'm not a > developer.) > > We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, > but it has one problem we can't overcome. > > Windows: > -------------------- > 2.2pre2 on Windows crashes when the connected device is turned off or > unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. > Hi Dave Sorry - I don't agree with above description - I have had more problems with 2.1.7... I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting USB dongle if I am using software construction shown in my previous examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. Everything is to safelly catch in Java and reconnect! There are several things more while working with system's suspend's as well. I have observed (mainly in W7) that small activity of the COM channel may results in VCP driver deactivation (or somethnig like that). Therefore I have prepared my external device to generate dummy data (SW software version) in declared time intervals. Problems has gone... In Vista there were enough to disable energy saving on USB ports in notebook - this problem wasn't observed on desktop. Regards Mariusz > Linux: > -------------------- > The best way I can explain the 2.2.pre2 problem on Linux is to paste this: > > "Tell them the read on the inputstream doesn't block, and when you enable > the receiveTimeout, it gets forgotten after the first bytes are received > [and it cannot be re-asserted]." > > Workarounds: > -------------------- > A workaround for the problem is possible on Windows, but we haven't found > one for Linux. > > Our code is doing something that is not done by the example code generous > people on this list helped me with. Our code receives many serial input > events over 24 hours without intentionally disconnecting. The receiveTimeout > problem is only evident after the first data packet is complete and the > connection remains open for some time. > > Furthermore, if the instrument is disconnected, our app needs to wait and > reconnect when the instrument becomes available. rxtx 2.2pre2 will not do > this (on Windows). However, 2.1.7 will handle the disconnect and recover. > > The biggest problem for us is 2.2pre2 on Linux because we haven't found any > workaround yet. We can't go back to 2.1.7 on Linux either (because it > apparently doesn't work). > > Wish I could say something that would be more meaningful to you guys > (especially the devs), but I hope what I have said is of value to someone. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Sat May 15 02:30:49 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 08:30:49 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 Message-ID: Hi, I just wanted to know why the parallel port dll for windows is missing in the pre2.2 binary package? Does anyone have it compiled and working? Thanks -- George H george.dma at gmail.com From george.dma at gmail.com Sat May 15 03:33:08 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 09:33:08 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 In-Reply-To: References: Message-ID: On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked?? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > From mariusz.dec at gmail.com Sat May 15 05:38:29 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 15 May 2010 13:38:29 +0200 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 References: Message-ID: <57E4C18871C249EC82846512B38F121D@mdam2> Hi, I have just compiled it, but my RXTX 2.2 pre hasn't last CVS's. Do you have any FTP? Many mail relay servers blocks mails with dll's. Regards Mariusz ----- Original Message ----- From: "George H" To: "rxtx" Sent: Saturday, May 15, 2010 11:33 AM Subject: Re: [Rxtx] ParallelPort dll missing for windows in pre2.2 On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From davestechshop at gmail.com Sat May 15 15:04:02 2010 From: davestechshop at gmail.com (Dave) Date: Sat, 15 May 2010 17:04:02 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: Your example code was very, very helpful. However, the developer told me that your example code does not test the scenarios we are encountering. I'll see if I can get him to post a little more info. Sorry I don't have more to add at this time. Dave On Sat, May 15, 2010 at 2:52 AM, Mariusz Dec wrote: > > > 2010/5/14 Dave > > Here is some non-technical feedback about rxtx on two platforms. (I'm not a >> developer.) >> >> We can't get 2.2pre2 to work reliably on Windows. It works better on >> Linux, but it has one problem we can't overcome. >> >> Windows: >> -------------------- >> 2.2pre2 on Windows crashes when the connected device is turned off or >> unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. >> > > Hi Dave > > Sorry - I don't agree with above description - I have had more problems > with 2.1.7... > > I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting > USB dongle if I am using software construction shown in my previous > examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. > Everything is to safelly catch in Java and reconnect! > > There are several things more while working with system's suspend's as > well. > > I have observed (mainly in W7) that small activity of the COM channel may > results in VCP driver deactivation (or somethnig like that). > Therefore I have prepared my external device to generate dummy data (SW > software version) in declared time intervals. > Problems has gone... > In Vista there were enough to disable energy saving on USB ports in > notebook - this problem wasn't observed on desktop. > > > Regards > Mariusz > > >> Linux: >> -------------------- >> The best way I can explain the 2.2.pre2 problem on Linux is to paste this: >> >> "Tell them the read on the inputstream doesn't block, and when you enable >> the receiveTimeout, it gets forgotten after the first bytes are received >> [and it cannot be re-asserted]." >> >> Workarounds: >> -------------------- >> A workaround for the problem is possible on Windows, but we haven't found >> one for Linux. >> >> Our code is doing something that is not done by the example code generous >> people on this list helped me with. Our code receives many serial input >> events over 24 hours without intentionally disconnecting. The receiveTimeout >> problem is only evident after the first data packet is complete and the >> connection remains open for some time. >> >> Furthermore, if the instrument is disconnected, our app needs to wait and >> reconnect when the instrument becomes available. rxtx 2.2pre2 will not do >> this (on Windows). However, 2.1.7 will handle the disconnect and recover. >> >> The biggest problem for us is 2.2pre2 on Linux because we haven't found >> any workaround yet. We can't go back to 2.1.7 on Linux either (because it >> apparently doesn't work). >> >> Wish I could say something that would be more meaningful to you guys >> (especially the devs), but I hope what I have said is of value to someone. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ra85551 at gmail.com Fri May 14 08:51:34 2010 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Fri, 14 May 2010 18:51:34 +0400 Subject: [Rxtx] problem with compiling RXTX for OpenWrt 10.03 host Message-ID: Hello, I try to compile RXTX for use on OpenWrt box. ./configure --host=mipsel-openwrt-linux --prefix=/home/pavel/rxtx2.2-bin make But I've been got a following error: mipsel-openwrt-linux-gcc -I/home/pavel/rxtx-2.2pre2 -Imipsel-openwrt-linux-gnu -I. -I/opt/java/include -I/opt/java/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/pavel/rxtx-2.2pre2/./src/RawImp.c -fPIC -DPIC -o /home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/.libs/RawImp.o /home/pavel/rxtx-2.2pre2/./src/RawImp.c:104:20: sys/io.h: No such file or directory libtool: link: `/home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/RawImp.lo' is not a valid libtool object I've found no better solution than comment out entire line 104 in src/RawImp.c 104c104 < //#include --- > #include After that compilation has been succeeded. But is this the best way to compile? -- Pavel Parkhomenko From davestechshop at gmail.com Fri May 14 13:08:58 2010 From: davestechshop at gmail.com (Dave) Date: Fri, 14 May 2010 15:08:58 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux Message-ID: Here is some non-technical feedback about rxtx on two platforms. (I'm not a developer.) We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, but it has one problem we can't overcome. Windows: -------------------- 2.2pre2 on Windows crashes when the connected device is turned off or unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. Linux: -------------------- The best way I can explain the 2.2.pre2 problem on Linux is to paste this: "Tell them the read on the inputstream doesn't block, and when you enable the receiveTimeout, it gets forgotten after the first bytes are received [and it cannot be re-asserted]." Workarounds: -------------------- A workaround for the problem is possible on Windows, but we haven't found one for Linux. Our code is doing something that is not done by the example code generous people on this list helped me with. Our code receives many serial input events over 24 hours without intentionally disconnecting. The receiveTimeout problem is only evident after the first data packet is complete and the connection remains open for some time. Furthermore, if the instrument is disconnected, our app needs to wait and reconnect when the instrument becomes available. rxtx 2.2pre2 will not do this (on Windows). However, 2.1.7 will handle the disconnect and recover. The biggest problem for us is 2.2pre2 on Linux because we haven't found any workaround yet. We can't go back to 2.1.7 on Linux either (because it apparently doesn't work). Wish I could say something that would be more meaningful to you guys (especially the devs), but I hope what I have said is of value to someone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 15 00:52:11 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 15 May 2010 08:52:11 +0200 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: 2010/5/14 Dave > Here is some non-technical feedback about rxtx on two platforms. (I'm not a > developer.) > > We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, > but it has one problem we can't overcome. > > Windows: > -------------------- > 2.2pre2 on Windows crashes when the connected device is turned off or > unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. > Hi Dave Sorry - I don't agree with above description - I have had more problems with 2.1.7... I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting USB dongle if I am using software construction shown in my previous examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. Everything is to safelly catch in Java and reconnect! There are several things more while working with system's suspend's as well. I have observed (mainly in W7) that small activity of the COM channel may results in VCP driver deactivation (or somethnig like that). Therefore I have prepared my external device to generate dummy data (SW software version) in declared time intervals. Problems has gone... In Vista there were enough to disable energy saving on USB ports in notebook - this problem wasn't observed on desktop. Regards Mariusz > Linux: > -------------------- > The best way I can explain the 2.2.pre2 problem on Linux is to paste this: > > "Tell them the read on the inputstream doesn't block, and when you enable > the receiveTimeout, it gets forgotten after the first bytes are received > [and it cannot be re-asserted]." > > Workarounds: > -------------------- > A workaround for the problem is possible on Windows, but we haven't found > one for Linux. > > Our code is doing something that is not done by the example code generous > people on this list helped me with. Our code receives many serial input > events over 24 hours without intentionally disconnecting. The receiveTimeout > problem is only evident after the first data packet is complete and the > connection remains open for some time. > > Furthermore, if the instrument is disconnected, our app needs to wait and > reconnect when the instrument becomes available. rxtx 2.2pre2 will not do > this (on Windows). However, 2.1.7 will handle the disconnect and recover. > > The biggest problem for us is 2.2pre2 on Linux because we haven't found any > workaround yet. We can't go back to 2.1.7 on Linux either (because it > apparently doesn't work). > > Wish I could say something that would be more meaningful to you guys > (especially the devs), but I hope what I have said is of value to someone. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Sat May 15 02:30:49 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 08:30:49 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 Message-ID: Hi, I just wanted to know why the parallel port dll for windows is missing in the pre2.2 binary package? Does anyone have it compiled and working? Thanks -- George H george.dma at gmail.com From george.dma at gmail.com Sat May 15 03:33:08 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 09:33:08 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 In-Reply-To: References: Message-ID: On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked?? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > From mariusz.dec at gmail.com Sat May 15 05:38:29 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 15 May 2010 13:38:29 +0200 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 References: Message-ID: <57E4C18871C249EC82846512B38F121D@mdam2> Hi, I have just compiled it, but my RXTX 2.2 pre hasn't last CVS's. Do you have any FTP? Many mail relay servers blocks mails with dll's. Regards Mariusz ----- Original Message ----- From: "George H" To: "rxtx" Sent: Saturday, May 15, 2010 11:33 AM Subject: Re: [Rxtx] ParallelPort dll missing for windows in pre2.2 On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From davestechshop at gmail.com Sat May 15 15:04:02 2010 From: davestechshop at gmail.com (Dave) Date: Sat, 15 May 2010 17:04:02 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: Your example code was very, very helpful. However, the developer told me that your example code does not test the scenarios we are encountering. I'll see if I can get him to post a little more info. Sorry I don't have more to add at this time. Dave On Sat, May 15, 2010 at 2:52 AM, Mariusz Dec wrote: > > > 2010/5/14 Dave > > Here is some non-technical feedback about rxtx on two platforms. (I'm not a >> developer.) >> >> We can't get 2.2pre2 to work reliably on Windows. It works better on >> Linux, but it has one problem we can't overcome. >> >> Windows: >> -------------------- >> 2.2pre2 on Windows crashes when the connected device is turned off or >> unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. >> > > Hi Dave > > Sorry - I don't agree with above description - I have had more problems > with 2.1.7... > > I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting > USB dongle if I am using software construction shown in my previous > examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. > Everything is to safelly catch in Java and reconnect! > > There are several things more while working with system's suspend's as > well. > > I have observed (mainly in W7) that small activity of the COM channel may > results in VCP driver deactivation (or somethnig like that). > Therefore I have prepared my external device to generate dummy data (SW > software version) in declared time intervals. > Problems has gone... > In Vista there were enough to disable energy saving on USB ports in > notebook - this problem wasn't observed on desktop. > > > Regards > Mariusz > > >> Linux: >> -------------------- >> The best way I can explain the 2.2.pre2 problem on Linux is to paste this: >> >> "Tell them the read on the inputstream doesn't block, and when you enable >> the receiveTimeout, it gets forgotten after the first bytes are received >> [and it cannot be re-asserted]." >> >> Workarounds: >> -------------------- >> A workaround for the problem is possible on Windows, but we haven't found >> one for Linux. >> >> Our code is doing something that is not done by the example code generous >> people on this list helped me with. Our code receives many serial input >> events over 24 hours without intentionally disconnecting. The receiveTimeout >> problem is only evident after the first data packet is complete and the >> connection remains open for some time. >> >> Furthermore, if the instrument is disconnected, our app needs to wait and >> reconnect when the instrument becomes available. rxtx 2.2pre2 will not do >> this (on Windows). However, 2.1.7 will handle the disconnect and recover. >> >> The biggest problem for us is 2.2pre2 on Linux because we haven't found >> any workaround yet. We can't go back to 2.1.7 on Linux either (because it >> apparently doesn't work). >> >> Wish I could say something that would be more meaningful to you guys >> (especially the devs), but I hope what I have said is of value to someone. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon May 17 08:36:43 2010 From: george.dma at gmail.com (George H) Date: Mon, 17 May 2010 14:36:43 +0000 Subject: [Rxtx] Printing hangs when sending data to parallel port Message-ID: Hi, I am getting a really weird and annoying problem and I have exhausted all options. I am using rxtx pre2.2 on linux. I am connecting to a receipt printer on a parallel port (/dev/lp0) The receipt printer has a 4.0Kb data buffer Here's the problem. In my java program when I send it bytes (and I do a .flush() after each invocation of .write(byte[])) it prints the data but stops arbitrarily during the print process. I wait a bit... re-send the data to get printed. 1 out of 3 times it succeeds and prints everything. But with long data it has problems. Now here is the weird part. I create a text file with 7Kb of text data. I run the command "cat test.txt > /dev/lp0" and the printer prints everything in 1 go without any problems. So I don't know, I am thinking maybe this is a problem with rxtx ? maybe I need to set some parallel parameters? Or should I try reverting to the 2.1 version of rxtx if the parallel code is more reliable? Thanks for helping -- George H george.dma at gmail.com From george.dma at gmail.com Tue May 18 00:16:54 2010 From: george.dma at gmail.com (George H) Date: Tue, 18 May 2010 09:16:54 +0300 Subject: [Rxtx] Printing hangs when sending data to parallel port In-Reply-To: References: Message-ID: On Mon, May 17, 2010 at 5:36 PM, George H wrote: > Hi, > > I am getting a really weird and annoying problem and I have exhausted > all options. I am using rxtx pre2.2 on linux. > I am connecting to a receipt printer on a parallel port (/dev/lp0) The > receipt printer has a 4.0Kb data buffer > > Here's the problem. In my java program when I send it bytes (and I do > a .flush() after each invocation of .write(byte[])) it prints the data > but stops arbitrarily during the print process. I wait a bit... > re-send the data to get printed. 1 out of 3 times it succeeds and > prints everything. But with long data it has problems. > > Now here is the weird part. I create a text file with 7Kb of text > data. I run the command ? "cat test.txt > /dev/lp0" and the printer > prints everything in 1 go without any problems. > > So I don't know, I am thinking maybe this is a problem with rxtx ? > maybe I need to set some parallel parameters? Or should I try > reverting to the 2.1 version of rxtx if the parallel code is more > reliable? > > Thanks for helping After testing we found out that we need to send the text to the printer as UTF8 bytes and best to include a 50ms blocking parameter when connecting to the parallel port. So I'm glad to say that rxtx was not the problem, just me not knowing the above were a requirement. > > -- > George H > george.dma at gmail.com > From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ra85551 at gmail.com Fri May 14 08:51:34 2010 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Fri, 14 May 2010 18:51:34 +0400 Subject: [Rxtx] problem with compiling RXTX for OpenWrt 10.03 host Message-ID: Hello, I try to compile RXTX for use on OpenWrt box. ./configure --host=mipsel-openwrt-linux --prefix=/home/pavel/rxtx2.2-bin make But I've been got a following error: mipsel-openwrt-linux-gcc -I/home/pavel/rxtx-2.2pre2 -Imipsel-openwrt-linux-gnu -I. -I/opt/java/include -I/opt/java/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/pavel/rxtx-2.2pre2/./src/RawImp.c -fPIC -DPIC -o /home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/.libs/RawImp.o /home/pavel/rxtx-2.2pre2/./src/RawImp.c:104:20: sys/io.h: No such file or directory libtool: link: `/home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/RawImp.lo' is not a valid libtool object I've found no better solution than comment out entire line 104 in src/RawImp.c 104c104 < //#include --- > #include After that compilation has been succeeded. But is this the best way to compile? -- Pavel Parkhomenko From davestechshop at gmail.com Fri May 14 13:08:58 2010 From: davestechshop at gmail.com (Dave) Date: Fri, 14 May 2010 15:08:58 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux Message-ID: Here is some non-technical feedback about rxtx on two platforms. (I'm not a developer.) We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, but it has one problem we can't overcome. Windows: -------------------- 2.2pre2 on Windows crashes when the connected device is turned off or unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. Linux: -------------------- The best way I can explain the 2.2.pre2 problem on Linux is to paste this: "Tell them the read on the inputstream doesn't block, and when you enable the receiveTimeout, it gets forgotten after the first bytes are received [and it cannot be re-asserted]." Workarounds: -------------------- A workaround for the problem is possible on Windows, but we haven't found one for Linux. Our code is doing something that is not done by the example code generous people on this list helped me with. Our code receives many serial input events over 24 hours without intentionally disconnecting. The receiveTimeout problem is only evident after the first data packet is complete and the connection remains open for some time. Furthermore, if the instrument is disconnected, our app needs to wait and reconnect when the instrument becomes available. rxtx 2.2pre2 will not do this (on Windows). However, 2.1.7 will handle the disconnect and recover. The biggest problem for us is 2.2pre2 on Linux because we haven't found any workaround yet. We can't go back to 2.1.7 on Linux either (because it apparently doesn't work). Wish I could say something that would be more meaningful to you guys (especially the devs), but I hope what I have said is of value to someone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 15 00:52:11 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 15 May 2010 08:52:11 +0200 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: 2010/5/14 Dave > Here is some non-technical feedback about rxtx on two platforms. (I'm not a > developer.) > > We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, > but it has one problem we can't overcome. > > Windows: > -------------------- > 2.2pre2 on Windows crashes when the connected device is turned off or > unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. > Hi Dave Sorry - I don't agree with above description - I have had more problems with 2.1.7... I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting USB dongle if I am using software construction shown in my previous examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. Everything is to safelly catch in Java and reconnect! There are several things more while working with system's suspend's as well. I have observed (mainly in W7) that small activity of the COM channel may results in VCP driver deactivation (or somethnig like that). Therefore I have prepared my external device to generate dummy data (SW software version) in declared time intervals. Problems has gone... In Vista there were enough to disable energy saving on USB ports in notebook - this problem wasn't observed on desktop. Regards Mariusz > Linux: > -------------------- > The best way I can explain the 2.2.pre2 problem on Linux is to paste this: > > "Tell them the read on the inputstream doesn't block, and when you enable > the receiveTimeout, it gets forgotten after the first bytes are received > [and it cannot be re-asserted]." > > Workarounds: > -------------------- > A workaround for the problem is possible on Windows, but we haven't found > one for Linux. > > Our code is doing something that is not done by the example code generous > people on this list helped me with. Our code receives many serial input > events over 24 hours without intentionally disconnecting. The receiveTimeout > problem is only evident after the first data packet is complete and the > connection remains open for some time. > > Furthermore, if the instrument is disconnected, our app needs to wait and > reconnect when the instrument becomes available. rxtx 2.2pre2 will not do > this (on Windows). However, 2.1.7 will handle the disconnect and recover. > > The biggest problem for us is 2.2pre2 on Linux because we haven't found any > workaround yet. We can't go back to 2.1.7 on Linux either (because it > apparently doesn't work). > > Wish I could say something that would be more meaningful to you guys > (especially the devs), but I hope what I have said is of value to someone. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Sat May 15 02:30:49 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 08:30:49 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 Message-ID: Hi, I just wanted to know why the parallel port dll for windows is missing in the pre2.2 binary package? Does anyone have it compiled and working? Thanks -- George H george.dma at gmail.com From george.dma at gmail.com Sat May 15 03:33:08 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 09:33:08 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 In-Reply-To: References: Message-ID: On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked?? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > From mariusz.dec at gmail.com Sat May 15 05:38:29 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 15 May 2010 13:38:29 +0200 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 References: Message-ID: <57E4C18871C249EC82846512B38F121D@mdam2> Hi, I have just compiled it, but my RXTX 2.2 pre hasn't last CVS's. Do you have any FTP? Many mail relay servers blocks mails with dll's. Regards Mariusz ----- Original Message ----- From: "George H" To: "rxtx" Sent: Saturday, May 15, 2010 11:33 AM Subject: Re: [Rxtx] ParallelPort dll missing for windows in pre2.2 On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From davestechshop at gmail.com Sat May 15 15:04:02 2010 From: davestechshop at gmail.com (Dave) Date: Sat, 15 May 2010 17:04:02 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: Your example code was very, very helpful. However, the developer told me that your example code does not test the scenarios we are encountering. I'll see if I can get him to post a little more info. Sorry I don't have more to add at this time. Dave On Sat, May 15, 2010 at 2:52 AM, Mariusz Dec wrote: > > > 2010/5/14 Dave > > Here is some non-technical feedback about rxtx on two platforms. (I'm not a >> developer.) >> >> We can't get 2.2pre2 to work reliably on Windows. It works better on >> Linux, but it has one problem we can't overcome. >> >> Windows: >> -------------------- >> 2.2pre2 on Windows crashes when the connected device is turned off or >> unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. >> > > Hi Dave > > Sorry - I don't agree with above description - I have had more problems > with 2.1.7... > > I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting > USB dongle if I am using software construction shown in my previous > examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. > Everything is to safelly catch in Java and reconnect! > > There are several things more while working with system's suspend's as > well. > > I have observed (mainly in W7) that small activity of the COM channel may > results in VCP driver deactivation (or somethnig like that). > Therefore I have prepared my external device to generate dummy data (SW > software version) in declared time intervals. > Problems has gone... > In Vista there were enough to disable energy saving on USB ports in > notebook - this problem wasn't observed on desktop. > > > Regards > Mariusz > > >> Linux: >> -------------------- >> The best way I can explain the 2.2.pre2 problem on Linux is to paste this: >> >> "Tell them the read on the inputstream doesn't block, and when you enable >> the receiveTimeout, it gets forgotten after the first bytes are received >> [and it cannot be re-asserted]." >> >> Workarounds: >> -------------------- >> A workaround for the problem is possible on Windows, but we haven't found >> one for Linux. >> >> Our code is doing something that is not done by the example code generous >> people on this list helped me with. Our code receives many serial input >> events over 24 hours without intentionally disconnecting. The receiveTimeout >> problem is only evident after the first data packet is complete and the >> connection remains open for some time. >> >> Furthermore, if the instrument is disconnected, our app needs to wait and >> reconnect when the instrument becomes available. rxtx 2.2pre2 will not do >> this (on Windows). However, 2.1.7 will handle the disconnect and recover. >> >> The biggest problem for us is 2.2pre2 on Linux because we haven't found >> any workaround yet. We can't go back to 2.1.7 on Linux either (because it >> apparently doesn't work). >> >> Wish I could say something that would be more meaningful to you guys >> (especially the devs), but I hope what I have said is of value to someone. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon May 17 08:36:43 2010 From: george.dma at gmail.com (George H) Date: Mon, 17 May 2010 14:36:43 +0000 Subject: [Rxtx] Printing hangs when sending data to parallel port Message-ID: Hi, I am getting a really weird and annoying problem and I have exhausted all options. I am using rxtx pre2.2 on linux. I am connecting to a receipt printer on a parallel port (/dev/lp0) The receipt printer has a 4.0Kb data buffer Here's the problem. In my java program when I send it bytes (and I do a .flush() after each invocation of .write(byte[])) it prints the data but stops arbitrarily during the print process. I wait a bit... re-send the data to get printed. 1 out of 3 times it succeeds and prints everything. But with long data it has problems. Now here is the weird part. I create a text file with 7Kb of text data. I run the command "cat test.txt > /dev/lp0" and the printer prints everything in 1 go without any problems. So I don't know, I am thinking maybe this is a problem with rxtx ? maybe I need to set some parallel parameters? Or should I try reverting to the 2.1 version of rxtx if the parallel code is more reliable? Thanks for helping -- George H george.dma at gmail.com From george.dma at gmail.com Tue May 18 00:16:54 2010 From: george.dma at gmail.com (George H) Date: Tue, 18 May 2010 09:16:54 +0300 Subject: [Rxtx] Printing hangs when sending data to parallel port In-Reply-To: References: Message-ID: On Mon, May 17, 2010 at 5:36 PM, George H wrote: > Hi, > > I am getting a really weird and annoying problem and I have exhausted > all options. I am using rxtx pre2.2 on linux. > I am connecting to a receipt printer on a parallel port (/dev/lp0) The > receipt printer has a 4.0Kb data buffer > > Here's the problem. In my java program when I send it bytes (and I do > a .flush() after each invocation of .write(byte[])) it prints the data > but stops arbitrarily during the print process. I wait a bit... > re-send the data to get printed. 1 out of 3 times it succeeds and > prints everything. But with long data it has problems. > > Now here is the weird part. I create a text file with 7Kb of text > data. I run the command ? "cat test.txt > /dev/lp0" and the printer > prints everything in 1 go without any problems. > > So I don't know, I am thinking maybe this is a problem with rxtx ? > maybe I need to set some parallel parameters? Or should I try > reverting to the 2.1 version of rxtx if the parallel code is more > reliable? > > Thanks for helping After testing we found out that we need to send the text to the printer as UTF8 bytes and best to include a 50ms blocking parameter when connecting to the parallel port. So I'm glad to say that rxtx was not the problem, just me not knowing the above were a requirement. > > -- > George H > george.dma at gmail.com > From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ra85551 at gmail.com Fri May 14 08:51:34 2010 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Fri, 14 May 2010 18:51:34 +0400 Subject: [Rxtx] problem with compiling RXTX for OpenWrt 10.03 host Message-ID: Hello, I try to compile RXTX for use on OpenWrt box. ./configure --host=mipsel-openwrt-linux --prefix=/home/pavel/rxtx2.2-bin make But I've been got a following error: mipsel-openwrt-linux-gcc -I/home/pavel/rxtx-2.2pre2 -Imipsel-openwrt-linux-gnu -I. -I/opt/java/include -I/opt/java/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/pavel/rxtx-2.2pre2/./src/RawImp.c -fPIC -DPIC -o /home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/.libs/RawImp.o /home/pavel/rxtx-2.2pre2/./src/RawImp.c:104:20: sys/io.h: No such file or directory libtool: link: `/home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/RawImp.lo' is not a valid libtool object I've found no better solution than comment out entire line 104 in src/RawImp.c 104c104 < //#include --- > #include After that compilation has been succeeded. But is this the best way to compile? -- Pavel Parkhomenko From davestechshop at gmail.com Fri May 14 13:08:58 2010 From: davestechshop at gmail.com (Dave) Date: Fri, 14 May 2010 15:08:58 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux Message-ID: Here is some non-technical feedback about rxtx on two platforms. (I'm not a developer.) We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, but it has one problem we can't overcome. Windows: -------------------- 2.2pre2 on Windows crashes when the connected device is turned off or unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. Linux: -------------------- The best way I can explain the 2.2.pre2 problem on Linux is to paste this: "Tell them the read on the inputstream doesn't block, and when you enable the receiveTimeout, it gets forgotten after the first bytes are received [and it cannot be re-asserted]." Workarounds: -------------------- A workaround for the problem is possible on Windows, but we haven't found one for Linux. Our code is doing something that is not done by the example code generous people on this list helped me with. Our code receives many serial input events over 24 hours without intentionally disconnecting. The receiveTimeout problem is only evident after the first data packet is complete and the connection remains open for some time. Furthermore, if the instrument is disconnected, our app needs to wait and reconnect when the instrument becomes available. rxtx 2.2pre2 will not do this (on Windows). However, 2.1.7 will handle the disconnect and recover. The biggest problem for us is 2.2pre2 on Linux because we haven't found any workaround yet. We can't go back to 2.1.7 on Linux either (because it apparently doesn't work). Wish I could say something that would be more meaningful to you guys (especially the devs), but I hope what I have said is of value to someone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 15 00:52:11 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 15 May 2010 08:52:11 +0200 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: 2010/5/14 Dave > Here is some non-technical feedback about rxtx on two platforms. (I'm not a > developer.) > > We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, > but it has one problem we can't overcome. > > Windows: > -------------------- > 2.2pre2 on Windows crashes when the connected device is turned off or > unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. > Hi Dave Sorry - I don't agree with above description - I have had more problems with 2.1.7... I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting USB dongle if I am using software construction shown in my previous examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. Everything is to safelly catch in Java and reconnect! There are several things more while working with system's suspend's as well. I have observed (mainly in W7) that small activity of the COM channel may results in VCP driver deactivation (or somethnig like that). Therefore I have prepared my external device to generate dummy data (SW software version) in declared time intervals. Problems has gone... In Vista there were enough to disable energy saving on USB ports in notebook - this problem wasn't observed on desktop. Regards Mariusz > Linux: > -------------------- > The best way I can explain the 2.2.pre2 problem on Linux is to paste this: > > "Tell them the read on the inputstream doesn't block, and when you enable > the receiveTimeout, it gets forgotten after the first bytes are received > [and it cannot be re-asserted]." > > Workarounds: > -------------------- > A workaround for the problem is possible on Windows, but we haven't found > one for Linux. > > Our code is doing something that is not done by the example code generous > people on this list helped me with. Our code receives many serial input > events over 24 hours without intentionally disconnecting. The receiveTimeout > problem is only evident after the first data packet is complete and the > connection remains open for some time. > > Furthermore, if the instrument is disconnected, our app needs to wait and > reconnect when the instrument becomes available. rxtx 2.2pre2 will not do > this (on Windows). However, 2.1.7 will handle the disconnect and recover. > > The biggest problem for us is 2.2pre2 on Linux because we haven't found any > workaround yet. We can't go back to 2.1.7 on Linux either (because it > apparently doesn't work). > > Wish I could say something that would be more meaningful to you guys > (especially the devs), but I hope what I have said is of value to someone. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Sat May 15 02:30:49 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 08:30:49 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 Message-ID: Hi, I just wanted to know why the parallel port dll for windows is missing in the pre2.2 binary package? Does anyone have it compiled and working? Thanks -- George H george.dma at gmail.com From george.dma at gmail.com Sat May 15 03:33:08 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 09:33:08 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 In-Reply-To: References: Message-ID: On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked?? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > From mariusz.dec at gmail.com Sat May 15 05:38:29 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 15 May 2010 13:38:29 +0200 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 References: Message-ID: <57E4C18871C249EC82846512B38F121D@mdam2> Hi, I have just compiled it, but my RXTX 2.2 pre hasn't last CVS's. Do you have any FTP? Many mail relay servers blocks mails with dll's. Regards Mariusz ----- Original Message ----- From: "George H" To: "rxtx" Sent: Saturday, May 15, 2010 11:33 AM Subject: Re: [Rxtx] ParallelPort dll missing for windows in pre2.2 On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From davestechshop at gmail.com Sat May 15 15:04:02 2010 From: davestechshop at gmail.com (Dave) Date: Sat, 15 May 2010 17:04:02 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: Your example code was very, very helpful. However, the developer told me that your example code does not test the scenarios we are encountering. I'll see if I can get him to post a little more info. Sorry I don't have more to add at this time. Dave On Sat, May 15, 2010 at 2:52 AM, Mariusz Dec wrote: > > > 2010/5/14 Dave > > Here is some non-technical feedback about rxtx on two platforms. (I'm not a >> developer.) >> >> We can't get 2.2pre2 to work reliably on Windows. It works better on >> Linux, but it has one problem we can't overcome. >> >> Windows: >> -------------------- >> 2.2pre2 on Windows crashes when the connected device is turned off or >> unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. >> > > Hi Dave > > Sorry - I don't agree with above description - I have had more problems > with 2.1.7... > > I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting > USB dongle if I am using software construction shown in my previous > examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. > Everything is to safelly catch in Java and reconnect! > > There are several things more while working with system's suspend's as > well. > > I have observed (mainly in W7) that small activity of the COM channel may > results in VCP driver deactivation (or somethnig like that). > Therefore I have prepared my external device to generate dummy data (SW > software version) in declared time intervals. > Problems has gone... > In Vista there were enough to disable energy saving on USB ports in > notebook - this problem wasn't observed on desktop. > > > Regards > Mariusz > > >> Linux: >> -------------------- >> The best way I can explain the 2.2.pre2 problem on Linux is to paste this: >> >> "Tell them the read on the inputstream doesn't block, and when you enable >> the receiveTimeout, it gets forgotten after the first bytes are received >> [and it cannot be re-asserted]." >> >> Workarounds: >> -------------------- >> A workaround for the problem is possible on Windows, but we haven't found >> one for Linux. >> >> Our code is doing something that is not done by the example code generous >> people on this list helped me with. Our code receives many serial input >> events over 24 hours without intentionally disconnecting. The receiveTimeout >> problem is only evident after the first data packet is complete and the >> connection remains open for some time. >> >> Furthermore, if the instrument is disconnected, our app needs to wait and >> reconnect when the instrument becomes available. rxtx 2.2pre2 will not do >> this (on Windows). However, 2.1.7 will handle the disconnect and recover. >> >> The biggest problem for us is 2.2pre2 on Linux because we haven't found >> any workaround yet. We can't go back to 2.1.7 on Linux either (because it >> apparently doesn't work). >> >> Wish I could say something that would be more meaningful to you guys >> (especially the devs), but I hope what I have said is of value to someone. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon May 17 08:36:43 2010 From: george.dma at gmail.com (George H) Date: Mon, 17 May 2010 14:36:43 +0000 Subject: [Rxtx] Printing hangs when sending data to parallel port Message-ID: Hi, I am getting a really weird and annoying problem and I have exhausted all options. I am using rxtx pre2.2 on linux. I am connecting to a receipt printer on a parallel port (/dev/lp0) The receipt printer has a 4.0Kb data buffer Here's the problem. In my java program when I send it bytes (and I do a .flush() after each invocation of .write(byte[])) it prints the data but stops arbitrarily during the print process. I wait a bit... re-send the data to get printed. 1 out of 3 times it succeeds and prints everything. But with long data it has problems. Now here is the weird part. I create a text file with 7Kb of text data. I run the command "cat test.txt > /dev/lp0" and the printer prints everything in 1 go without any problems. So I don't know, I am thinking maybe this is a problem with rxtx ? maybe I need to set some parallel parameters? Or should I try reverting to the 2.1 version of rxtx if the parallel code is more reliable? Thanks for helping -- George H george.dma at gmail.com From george.dma at gmail.com Tue May 18 00:16:54 2010 From: george.dma at gmail.com (George H) Date: Tue, 18 May 2010 09:16:54 +0300 Subject: [Rxtx] Printing hangs when sending data to parallel port In-Reply-To: References: Message-ID: On Mon, May 17, 2010 at 5:36 PM, George H wrote: > Hi, > > I am getting a really weird and annoying problem and I have exhausted > all options. I am using rxtx pre2.2 on linux. > I am connecting to a receipt printer on a parallel port (/dev/lp0) The > receipt printer has a 4.0Kb data buffer > > Here's the problem. In my java program when I send it bytes (and I do > a .flush() after each invocation of .write(byte[])) it prints the data > but stops arbitrarily during the print process. I wait a bit... > re-send the data to get printed. 1 out of 3 times it succeeds and > prints everything. But with long data it has problems. > > Now here is the weird part. I create a text file with 7Kb of text > data. I run the command ? "cat test.txt > /dev/lp0" and the printer > prints everything in 1 go without any problems. > > So I don't know, I am thinking maybe this is a problem with rxtx ? > maybe I need to set some parallel parameters? Or should I try > reverting to the 2.1 version of rxtx if the parallel code is more > reliable? > > Thanks for helping After testing we found out that we need to send the text to the printer as UTF8 bytes and best to include a 50ms blocking parameter when connecting to the parallel port. So I'm glad to say that rxtx was not the problem, just me not knowing the above were a requirement. > > -- > George H > george.dma at gmail.com > From george.dma at gmail.com Wed May 19 11:17:55 2010 From: george.dma at gmail.com (George H) Date: Wed, 19 May 2010 17:17:55 +0000 Subject: [Rxtx] Resource temporarily unavailable on writeByte() Message-ID: Hi, This affects rxtx 2.1.7 and 2.2pre2 I have a POS receipt printer connected via parallel port. The BIOS is set to use SPP more for the parallel port. I am sending bytes to the parallel outputstream using the out.write(int b) method and just for safety I call flush after each write.. out.write(b); out.flush(); When I queue up arrays of bytes to be written that way, it will keep printing and then throw a "java.io.IOException: Resource temporarily unavailable in writeByte" all the time. I did a dirty workaround by pausing 2 seconds between printing receipts and it seems to postpone the error from happening, but it still happens. I thought it was maybe a threading problem from my app... so I made a program to just skip all the threading stuff and just print directly. Same problem. The below exception was thrown when using the 2.1.7 version of rxtx java.io.IOException: Resource temporarily unavailable in writeArray com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2381) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) Caused by: Resource temporarily unavailable in writeArray gnu.io.LPRPort.writeArray(Native Method) gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:281) com.gi.pos.comm.parallel.ParallelCommWriter.write(ParallelCommWriter.java:62) com.gi.pos.comm.parallel.ParallelCommWriter.writeString(ParallelCommWriter.java:52) com.gi.pos.comm.POSCommPort.writeString(POSCommPort.java:95) com.gi.resto.printer.RestoPOSPrinter.writeTwoStrings(RestoPOSPrinter.java:3045) com.gi.resto.printer.RestoPOSPrinter.writeCondimentString(RestoPOSPrinter.java:3074) com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2145) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) I've tried everything possible and also, I don't know if this is implemented or not but ParallelPort.isPrinterBusy() always returns false, is this normal? And it seems rxtx setting the parallel mode to EPP or ECP always throws and exception even though my bios supports those modes. Please help, this is frustrating :S -- George H george.dma at gmail.com From thomas.shulok at lmco.com Wed May 19 18:40:38 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Wed, 19 May 2010 18:40:38 -0600 Subject: [Rxtx] lock files, expected behavior? Message-ID: Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 05:05:41 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 20 May 2010 13:05:41 +0200 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, > > > > I know there are a ton of questions about lock files (I think I?ve read all > of them at this point J, but my question is slightly different. In my > application, I initially do a CommPortIdentifier.*getPortIdentifiers*(), > and I get back all my expected com ports. No problem there. Subsequently, > I acquire a port via CommPortIdentifier.*open*(). No problem. But now, > when I do a subsequent CommPortIdentifier.*getPortIdentifiers*(), the port > I acquired is no longer included in the returned enumeration. For the port > in question, the call to getPortIdentifiers produces > > > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File > exists > > > > in the log. Everything I?m doing is in one process space. I?ve confirmed > that my PID and the PID inside the lock file are the same. Does the > implementation check to see if the PID in the lock file is the same as the > PID of the caller, or does it merely check for the existence of the lock > file and bail, regardless of who the caller is? Or am I missing something > else? > > > > Thanks, > > Thom > > (rxtx-2.1.7-r2) > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.shulok at lmco.com Thu May 20 07:43:13 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 20 May 2010 07:43:13 -0600 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ra85551 at gmail.com Fri May 14 08:51:34 2010 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Fri, 14 May 2010 18:51:34 +0400 Subject: [Rxtx] problem with compiling RXTX for OpenWrt 10.03 host Message-ID: Hello, I try to compile RXTX for use on OpenWrt box. ./configure --host=mipsel-openwrt-linux --prefix=/home/pavel/rxtx2.2-bin make But I've been got a following error: mipsel-openwrt-linux-gcc -I/home/pavel/rxtx-2.2pre2 -Imipsel-openwrt-linux-gnu -I. -I/opt/java/include -I/opt/java/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/pavel/rxtx-2.2pre2/./src/RawImp.c -fPIC -DPIC -o /home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/.libs/RawImp.o /home/pavel/rxtx-2.2pre2/./src/RawImp.c:104:20: sys/io.h: No such file or directory libtool: link: `/home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/RawImp.lo' is not a valid libtool object I've found no better solution than comment out entire line 104 in src/RawImp.c 104c104 < //#include --- > #include After that compilation has been succeeded. But is this the best way to compile? -- Pavel Parkhomenko From davestechshop at gmail.com Fri May 14 13:08:58 2010 From: davestechshop at gmail.com (Dave) Date: Fri, 14 May 2010 15:08:58 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux Message-ID: Here is some non-technical feedback about rxtx on two platforms. (I'm not a developer.) We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, but it has one problem we can't overcome. Windows: -------------------- 2.2pre2 on Windows crashes when the connected device is turned off or unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. Linux: -------------------- The best way I can explain the 2.2.pre2 problem on Linux is to paste this: "Tell them the read on the inputstream doesn't block, and when you enable the receiveTimeout, it gets forgotten after the first bytes are received [and it cannot be re-asserted]." Workarounds: -------------------- A workaround for the problem is possible on Windows, but we haven't found one for Linux. Our code is doing something that is not done by the example code generous people on this list helped me with. Our code receives many serial input events over 24 hours without intentionally disconnecting. The receiveTimeout problem is only evident after the first data packet is complete and the connection remains open for some time. Furthermore, if the instrument is disconnected, our app needs to wait and reconnect when the instrument becomes available. rxtx 2.2pre2 will not do this (on Windows). However, 2.1.7 will handle the disconnect and recover. The biggest problem for us is 2.2pre2 on Linux because we haven't found any workaround yet. We can't go back to 2.1.7 on Linux either (because it apparently doesn't work). Wish I could say something that would be more meaningful to you guys (especially the devs), but I hope what I have said is of value to someone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 15 00:52:11 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 15 May 2010 08:52:11 +0200 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: 2010/5/14 Dave > Here is some non-technical feedback about rxtx on two platforms. (I'm not a > developer.) > > We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, > but it has one problem we can't overcome. > > Windows: > -------------------- > 2.2pre2 on Windows crashes when the connected device is turned off or > unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. > Hi Dave Sorry - I don't agree with above description - I have had more problems with 2.1.7... I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting USB dongle if I am using software construction shown in my previous examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. Everything is to safelly catch in Java and reconnect! There are several things more while working with system's suspend's as well. I have observed (mainly in W7) that small activity of the COM channel may results in VCP driver deactivation (or somethnig like that). Therefore I have prepared my external device to generate dummy data (SW software version) in declared time intervals. Problems has gone... In Vista there were enough to disable energy saving on USB ports in notebook - this problem wasn't observed on desktop. Regards Mariusz > Linux: > -------------------- > The best way I can explain the 2.2.pre2 problem on Linux is to paste this: > > "Tell them the read on the inputstream doesn't block, and when you enable > the receiveTimeout, it gets forgotten after the first bytes are received > [and it cannot be re-asserted]." > > Workarounds: > -------------------- > A workaround for the problem is possible on Windows, but we haven't found > one for Linux. > > Our code is doing something that is not done by the example code generous > people on this list helped me with. Our code receives many serial input > events over 24 hours without intentionally disconnecting. The receiveTimeout > problem is only evident after the first data packet is complete and the > connection remains open for some time. > > Furthermore, if the instrument is disconnected, our app needs to wait and > reconnect when the instrument becomes available. rxtx 2.2pre2 will not do > this (on Windows). However, 2.1.7 will handle the disconnect and recover. > > The biggest problem for us is 2.2pre2 on Linux because we haven't found any > workaround yet. We can't go back to 2.1.7 on Linux either (because it > apparently doesn't work). > > Wish I could say something that would be more meaningful to you guys > (especially the devs), but I hope what I have said is of value to someone. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Sat May 15 02:30:49 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 08:30:49 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 Message-ID: Hi, I just wanted to know why the parallel port dll for windows is missing in the pre2.2 binary package? Does anyone have it compiled and working? Thanks -- George H george.dma at gmail.com From george.dma at gmail.com Sat May 15 03:33:08 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 09:33:08 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 In-Reply-To: References: Message-ID: On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked?? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > From mariusz.dec at gmail.com Sat May 15 05:38:29 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 15 May 2010 13:38:29 +0200 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 References: Message-ID: <57E4C18871C249EC82846512B38F121D@mdam2> Hi, I have just compiled it, but my RXTX 2.2 pre hasn't last CVS's. Do you have any FTP? Many mail relay servers blocks mails with dll's. Regards Mariusz ----- Original Message ----- From: "George H" To: "rxtx" Sent: Saturday, May 15, 2010 11:33 AM Subject: Re: [Rxtx] ParallelPort dll missing for windows in pre2.2 On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From davestechshop at gmail.com Sat May 15 15:04:02 2010 From: davestechshop at gmail.com (Dave) Date: Sat, 15 May 2010 17:04:02 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: Your example code was very, very helpful. However, the developer told me that your example code does not test the scenarios we are encountering. I'll see if I can get him to post a little more info. Sorry I don't have more to add at this time. Dave On Sat, May 15, 2010 at 2:52 AM, Mariusz Dec wrote: > > > 2010/5/14 Dave > > Here is some non-technical feedback about rxtx on two platforms. (I'm not a >> developer.) >> >> We can't get 2.2pre2 to work reliably on Windows. It works better on >> Linux, but it has one problem we can't overcome. >> >> Windows: >> -------------------- >> 2.2pre2 on Windows crashes when the connected device is turned off or >> unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. >> > > Hi Dave > > Sorry - I don't agree with above description - I have had more problems > with 2.1.7... > > I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting > USB dongle if I am using software construction shown in my previous > examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. > Everything is to safelly catch in Java and reconnect! > > There are several things more while working with system's suspend's as > well. > > I have observed (mainly in W7) that small activity of the COM channel may > results in VCP driver deactivation (or somethnig like that). > Therefore I have prepared my external device to generate dummy data (SW > software version) in declared time intervals. > Problems has gone... > In Vista there were enough to disable energy saving on USB ports in > notebook - this problem wasn't observed on desktop. > > > Regards > Mariusz > > >> Linux: >> -------------------- >> The best way I can explain the 2.2.pre2 problem on Linux is to paste this: >> >> "Tell them the read on the inputstream doesn't block, and when you enable >> the receiveTimeout, it gets forgotten after the first bytes are received >> [and it cannot be re-asserted]." >> >> Workarounds: >> -------------------- >> A workaround for the problem is possible on Windows, but we haven't found >> one for Linux. >> >> Our code is doing something that is not done by the example code generous >> people on this list helped me with. Our code receives many serial input >> events over 24 hours without intentionally disconnecting. The receiveTimeout >> problem is only evident after the first data packet is complete and the >> connection remains open for some time. >> >> Furthermore, if the instrument is disconnected, our app needs to wait and >> reconnect when the instrument becomes available. rxtx 2.2pre2 will not do >> this (on Windows). However, 2.1.7 will handle the disconnect and recover. >> >> The biggest problem for us is 2.2pre2 on Linux because we haven't found >> any workaround yet. We can't go back to 2.1.7 on Linux either (because it >> apparently doesn't work). >> >> Wish I could say something that would be more meaningful to you guys >> (especially the devs), but I hope what I have said is of value to someone. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon May 17 08:36:43 2010 From: george.dma at gmail.com (George H) Date: Mon, 17 May 2010 14:36:43 +0000 Subject: [Rxtx] Printing hangs when sending data to parallel port Message-ID: Hi, I am getting a really weird and annoying problem and I have exhausted all options. I am using rxtx pre2.2 on linux. I am connecting to a receipt printer on a parallel port (/dev/lp0) The receipt printer has a 4.0Kb data buffer Here's the problem. In my java program when I send it bytes (and I do a .flush() after each invocation of .write(byte[])) it prints the data but stops arbitrarily during the print process. I wait a bit... re-send the data to get printed. 1 out of 3 times it succeeds and prints everything. But with long data it has problems. Now here is the weird part. I create a text file with 7Kb of text data. I run the command "cat test.txt > /dev/lp0" and the printer prints everything in 1 go without any problems. So I don't know, I am thinking maybe this is a problem with rxtx ? maybe I need to set some parallel parameters? Or should I try reverting to the 2.1 version of rxtx if the parallel code is more reliable? Thanks for helping -- George H george.dma at gmail.com From george.dma at gmail.com Tue May 18 00:16:54 2010 From: george.dma at gmail.com (George H) Date: Tue, 18 May 2010 09:16:54 +0300 Subject: [Rxtx] Printing hangs when sending data to parallel port In-Reply-To: References: Message-ID: On Mon, May 17, 2010 at 5:36 PM, George H wrote: > Hi, > > I am getting a really weird and annoying problem and I have exhausted > all options. I am using rxtx pre2.2 on linux. > I am connecting to a receipt printer on a parallel port (/dev/lp0) The > receipt printer has a 4.0Kb data buffer > > Here's the problem. In my java program when I send it bytes (and I do > a .flush() after each invocation of .write(byte[])) it prints the data > but stops arbitrarily during the print process. I wait a bit... > re-send the data to get printed. 1 out of 3 times it succeeds and > prints everything. But with long data it has problems. > > Now here is the weird part. I create a text file with 7Kb of text > data. I run the command ? "cat test.txt > /dev/lp0" and the printer > prints everything in 1 go without any problems. > > So I don't know, I am thinking maybe this is a problem with rxtx ? > maybe I need to set some parallel parameters? Or should I try > reverting to the 2.1 version of rxtx if the parallel code is more > reliable? > > Thanks for helping After testing we found out that we need to send the text to the printer as UTF8 bytes and best to include a 50ms blocking parameter when connecting to the parallel port. So I'm glad to say that rxtx was not the problem, just me not knowing the above were a requirement. > > -- > George H > george.dma at gmail.com > From george.dma at gmail.com Wed May 19 11:17:55 2010 From: george.dma at gmail.com (George H) Date: Wed, 19 May 2010 17:17:55 +0000 Subject: [Rxtx] Resource temporarily unavailable on writeByte() Message-ID: Hi, This affects rxtx 2.1.7 and 2.2pre2 I have a POS receipt printer connected via parallel port. The BIOS is set to use SPP more for the parallel port. I am sending bytes to the parallel outputstream using the out.write(int b) method and just for safety I call flush after each write.. out.write(b); out.flush(); When I queue up arrays of bytes to be written that way, it will keep printing and then throw a "java.io.IOException: Resource temporarily unavailable in writeByte" all the time. I did a dirty workaround by pausing 2 seconds between printing receipts and it seems to postpone the error from happening, but it still happens. I thought it was maybe a threading problem from my app... so I made a program to just skip all the threading stuff and just print directly. Same problem. The below exception was thrown when using the 2.1.7 version of rxtx java.io.IOException: Resource temporarily unavailable in writeArray com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2381) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) Caused by: Resource temporarily unavailable in writeArray gnu.io.LPRPort.writeArray(Native Method) gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:281) com.gi.pos.comm.parallel.ParallelCommWriter.write(ParallelCommWriter.java:62) com.gi.pos.comm.parallel.ParallelCommWriter.writeString(ParallelCommWriter.java:52) com.gi.pos.comm.POSCommPort.writeString(POSCommPort.java:95) com.gi.resto.printer.RestoPOSPrinter.writeTwoStrings(RestoPOSPrinter.java:3045) com.gi.resto.printer.RestoPOSPrinter.writeCondimentString(RestoPOSPrinter.java:3074) com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2145) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) I've tried everything possible and also, I don't know if this is implemented or not but ParallelPort.isPrinterBusy() always returns false, is this normal? And it seems rxtx setting the parallel mode to EPP or ECP always throws and exception even though my bios supports those modes. Please help, this is frustrating :S -- George H george.dma at gmail.com From thomas.shulok at lmco.com Wed May 19 18:40:38 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Wed, 19 May 2010 18:40:38 -0600 Subject: [Rxtx] lock files, expected behavior? Message-ID: Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 05:05:41 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 20 May 2010 13:05:41 +0200 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, > > > > I know there are a ton of questions about lock files (I think I?ve read all > of them at this point J, but my question is slightly different. In my > application, I initially do a CommPortIdentifier.*getPortIdentifiers*(), > and I get back all my expected com ports. No problem there. Subsequently, > I acquire a port via CommPortIdentifier.*open*(). No problem. But now, > when I do a subsequent CommPortIdentifier.*getPortIdentifiers*(), the port > I acquired is no longer included in the returned enumeration. For the port > in question, the call to getPortIdentifiers produces > > > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File > exists > > > > in the log. Everything I?m doing is in one process space. I?ve confirmed > that my PID and the PID inside the lock file are the same. Does the > implementation check to see if the PID in the lock file is the same as the > PID of the caller, or does it merely check for the existence of the lock > file and bail, regardless of who the caller is? Or am I missing something > else? > > > > Thanks, > > Thom > > (rxtx-2.1.7-r2) > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.shulok at lmco.com Thu May 20 07:43:13 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 20 May 2010 07:43:13 -0600 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Thu May 20 07:44:35 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Thu, 20 May 2010 15:44:35 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Message-ID: Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 07:56:34 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 15:56:34 +0200 Subject: [Rxtx] lock files, expected behavior? References: Message-ID: <81AA8C26A14E43279758AA42434576D9@mdam2> Hi, sorry for previous miss-click :) Shared access to serial ports is very diffucult even if native OS. IMHO this should be done at least in JNI or LOWER/DEEPER in OS, but I don't think that RXTX does it (I am not a developer, only user). So I can only suggest to join Java applications (processes) and sort data inside joined application. Regards Mariusz ----- Original Message ----- From: Shulok, Thomas To: Mariusz Dec Cc: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:43 PM Subject: RE: [Rxtx] lock files, expected behavior? Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point J, but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 08:26:43 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 16:26:43 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver References: Message-ID: <33FE508874504BF4B3A636FCF120D7C0@mdam2> Hi, If you have copied only final jre there is not enough. Installation of the RXTX bins must be compatible with local Java and/or system paths... This is of course theory, because Java is platform independent . In w7-32 there is enough to copy rxtxSerial.dll to Windows/system32 or to Java jre folders something like that: ....Java\jre6\bin\rxtxSerial.dll Regards Mariusz ----- Original Message ----- From: Hans Rupp To: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:44 PM Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu May 20 17:02:09 2010 From: george.dma at gmail.com (George H) Date: Thu, 20 May 2010 23:02:09 +0000 Subject: [Rxtx] Possible bug in ParallelImp.c Message-ID: Hi, I been looking for a reason why .isPrinterBusy() method always returns false for me and I was looking at the ParallelImp.c class and found this #if defined (__linux__) ioctl(fd, LPGETSTATUS, &status); #elif defined (WIN32) I assume this is trying to call the function from ppdev.c in the linux source code, am I right on this? If so then that method does not exist and should be "pp_ioctl" Can someone verify this for me please ? -- George H george.dma at gmail.com From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ra85551 at gmail.com Fri May 14 08:51:34 2010 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Fri, 14 May 2010 18:51:34 +0400 Subject: [Rxtx] problem with compiling RXTX for OpenWrt 10.03 host Message-ID: Hello, I try to compile RXTX for use on OpenWrt box. ./configure --host=mipsel-openwrt-linux --prefix=/home/pavel/rxtx2.2-bin make But I've been got a following error: mipsel-openwrt-linux-gcc -I/home/pavel/rxtx-2.2pre2 -Imipsel-openwrt-linux-gnu -I. -I/opt/java/include -I/opt/java/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/pavel/rxtx-2.2pre2/./src/RawImp.c -fPIC -DPIC -o /home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/.libs/RawImp.o /home/pavel/rxtx-2.2pre2/./src/RawImp.c:104:20: sys/io.h: No such file or directory libtool: link: `/home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/RawImp.lo' is not a valid libtool object I've found no better solution than comment out entire line 104 in src/RawImp.c 104c104 < //#include --- > #include After that compilation has been succeeded. But is this the best way to compile? -- Pavel Parkhomenko From davestechshop at gmail.com Fri May 14 13:08:58 2010 From: davestechshop at gmail.com (Dave) Date: Fri, 14 May 2010 15:08:58 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux Message-ID: Here is some non-technical feedback about rxtx on two platforms. (I'm not a developer.) We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, but it has one problem we can't overcome. Windows: -------------------- 2.2pre2 on Windows crashes when the connected device is turned off or unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. Linux: -------------------- The best way I can explain the 2.2.pre2 problem on Linux is to paste this: "Tell them the read on the inputstream doesn't block, and when you enable the receiveTimeout, it gets forgotten after the first bytes are received [and it cannot be re-asserted]." Workarounds: -------------------- A workaround for the problem is possible on Windows, but we haven't found one for Linux. Our code is doing something that is not done by the example code generous people on this list helped me with. Our code receives many serial input events over 24 hours without intentionally disconnecting. The receiveTimeout problem is only evident after the first data packet is complete and the connection remains open for some time. Furthermore, if the instrument is disconnected, our app needs to wait and reconnect when the instrument becomes available. rxtx 2.2pre2 will not do this (on Windows). However, 2.1.7 will handle the disconnect and recover. The biggest problem for us is 2.2pre2 on Linux because we haven't found any workaround yet. We can't go back to 2.1.7 on Linux either (because it apparently doesn't work). Wish I could say something that would be more meaningful to you guys (especially the devs), but I hope what I have said is of value to someone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 15 00:52:11 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 15 May 2010 08:52:11 +0200 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: 2010/5/14 Dave > Here is some non-technical feedback about rxtx on two platforms. (I'm not a > developer.) > > We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, > but it has one problem we can't overcome. > > Windows: > -------------------- > 2.2pre2 on Windows crashes when the connected device is turned off or > unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. > Hi Dave Sorry - I don't agree with above description - I have had more problems with 2.1.7... I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting USB dongle if I am using software construction shown in my previous examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. Everything is to safelly catch in Java and reconnect! There are several things more while working with system's suspend's as well. I have observed (mainly in W7) that small activity of the COM channel may results in VCP driver deactivation (or somethnig like that). Therefore I have prepared my external device to generate dummy data (SW software version) in declared time intervals. Problems has gone... In Vista there were enough to disable energy saving on USB ports in notebook - this problem wasn't observed on desktop. Regards Mariusz > Linux: > -------------------- > The best way I can explain the 2.2.pre2 problem on Linux is to paste this: > > "Tell them the read on the inputstream doesn't block, and when you enable > the receiveTimeout, it gets forgotten after the first bytes are received > [and it cannot be re-asserted]." > > Workarounds: > -------------------- > A workaround for the problem is possible on Windows, but we haven't found > one for Linux. > > Our code is doing something that is not done by the example code generous > people on this list helped me with. Our code receives many serial input > events over 24 hours without intentionally disconnecting. The receiveTimeout > problem is only evident after the first data packet is complete and the > connection remains open for some time. > > Furthermore, if the instrument is disconnected, our app needs to wait and > reconnect when the instrument becomes available. rxtx 2.2pre2 will not do > this (on Windows). However, 2.1.7 will handle the disconnect and recover. > > The biggest problem for us is 2.2pre2 on Linux because we haven't found any > workaround yet. We can't go back to 2.1.7 on Linux either (because it > apparently doesn't work). > > Wish I could say something that would be more meaningful to you guys > (especially the devs), but I hope what I have said is of value to someone. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Sat May 15 02:30:49 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 08:30:49 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 Message-ID: Hi, I just wanted to know why the parallel port dll for windows is missing in the pre2.2 binary package? Does anyone have it compiled and working? Thanks -- George H george.dma at gmail.com From george.dma at gmail.com Sat May 15 03:33:08 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 09:33:08 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 In-Reply-To: References: Message-ID: On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked?? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > From mariusz.dec at gmail.com Sat May 15 05:38:29 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 15 May 2010 13:38:29 +0200 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 References: Message-ID: <57E4C18871C249EC82846512B38F121D@mdam2> Hi, I have just compiled it, but my RXTX 2.2 pre hasn't last CVS's. Do you have any FTP? Many mail relay servers blocks mails with dll's. Regards Mariusz ----- Original Message ----- From: "George H" To: "rxtx" Sent: Saturday, May 15, 2010 11:33 AM Subject: Re: [Rxtx] ParallelPort dll missing for windows in pre2.2 On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From davestechshop at gmail.com Sat May 15 15:04:02 2010 From: davestechshop at gmail.com (Dave) Date: Sat, 15 May 2010 17:04:02 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: Your example code was very, very helpful. However, the developer told me that your example code does not test the scenarios we are encountering. I'll see if I can get him to post a little more info. Sorry I don't have more to add at this time. Dave On Sat, May 15, 2010 at 2:52 AM, Mariusz Dec wrote: > > > 2010/5/14 Dave > > Here is some non-technical feedback about rxtx on two platforms. (I'm not a >> developer.) >> >> We can't get 2.2pre2 to work reliably on Windows. It works better on >> Linux, but it has one problem we can't overcome. >> >> Windows: >> -------------------- >> 2.2pre2 on Windows crashes when the connected device is turned off or >> unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. >> > > Hi Dave > > Sorry - I don't agree with above description - I have had more problems > with 2.1.7... > > I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting > USB dongle if I am using software construction shown in my previous > examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. > Everything is to safelly catch in Java and reconnect! > > There are several things more while working with system's suspend's as > well. > > I have observed (mainly in W7) that small activity of the COM channel may > results in VCP driver deactivation (or somethnig like that). > Therefore I have prepared my external device to generate dummy data (SW > software version) in declared time intervals. > Problems has gone... > In Vista there were enough to disable energy saving on USB ports in > notebook - this problem wasn't observed on desktop. > > > Regards > Mariusz > > >> Linux: >> -------------------- >> The best way I can explain the 2.2.pre2 problem on Linux is to paste this: >> >> "Tell them the read on the inputstream doesn't block, and when you enable >> the receiveTimeout, it gets forgotten after the first bytes are received >> [and it cannot be re-asserted]." >> >> Workarounds: >> -------------------- >> A workaround for the problem is possible on Windows, but we haven't found >> one for Linux. >> >> Our code is doing something that is not done by the example code generous >> people on this list helped me with. Our code receives many serial input >> events over 24 hours without intentionally disconnecting. The receiveTimeout >> problem is only evident after the first data packet is complete and the >> connection remains open for some time. >> >> Furthermore, if the instrument is disconnected, our app needs to wait and >> reconnect when the instrument becomes available. rxtx 2.2pre2 will not do >> this (on Windows). However, 2.1.7 will handle the disconnect and recover. >> >> The biggest problem for us is 2.2pre2 on Linux because we haven't found >> any workaround yet. We can't go back to 2.1.7 on Linux either (because it >> apparently doesn't work). >> >> Wish I could say something that would be more meaningful to you guys >> (especially the devs), but I hope what I have said is of value to someone. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon May 17 08:36:43 2010 From: george.dma at gmail.com (George H) Date: Mon, 17 May 2010 14:36:43 +0000 Subject: [Rxtx] Printing hangs when sending data to parallel port Message-ID: Hi, I am getting a really weird and annoying problem and I have exhausted all options. I am using rxtx pre2.2 on linux. I am connecting to a receipt printer on a parallel port (/dev/lp0) The receipt printer has a 4.0Kb data buffer Here's the problem. In my java program when I send it bytes (and I do a .flush() after each invocation of .write(byte[])) it prints the data but stops arbitrarily during the print process. I wait a bit... re-send the data to get printed. 1 out of 3 times it succeeds and prints everything. But with long data it has problems. Now here is the weird part. I create a text file with 7Kb of text data. I run the command "cat test.txt > /dev/lp0" and the printer prints everything in 1 go without any problems. So I don't know, I am thinking maybe this is a problem with rxtx ? maybe I need to set some parallel parameters? Or should I try reverting to the 2.1 version of rxtx if the parallel code is more reliable? Thanks for helping -- George H george.dma at gmail.com From george.dma at gmail.com Tue May 18 00:16:54 2010 From: george.dma at gmail.com (George H) Date: Tue, 18 May 2010 09:16:54 +0300 Subject: [Rxtx] Printing hangs when sending data to parallel port In-Reply-To: References: Message-ID: On Mon, May 17, 2010 at 5:36 PM, George H wrote: > Hi, > > I am getting a really weird and annoying problem and I have exhausted > all options. I am using rxtx pre2.2 on linux. > I am connecting to a receipt printer on a parallel port (/dev/lp0) The > receipt printer has a 4.0Kb data buffer > > Here's the problem. In my java program when I send it bytes (and I do > a .flush() after each invocation of .write(byte[])) it prints the data > but stops arbitrarily during the print process. I wait a bit... > re-send the data to get printed. 1 out of 3 times it succeeds and > prints everything. But with long data it has problems. > > Now here is the weird part. I create a text file with 7Kb of text > data. I run the command ? "cat test.txt > /dev/lp0" and the printer > prints everything in 1 go without any problems. > > So I don't know, I am thinking maybe this is a problem with rxtx ? > maybe I need to set some parallel parameters? Or should I try > reverting to the 2.1 version of rxtx if the parallel code is more > reliable? > > Thanks for helping After testing we found out that we need to send the text to the printer as UTF8 bytes and best to include a 50ms blocking parameter when connecting to the parallel port. So I'm glad to say that rxtx was not the problem, just me not knowing the above were a requirement. > > -- > George H > george.dma at gmail.com > From george.dma at gmail.com Wed May 19 11:17:55 2010 From: george.dma at gmail.com (George H) Date: Wed, 19 May 2010 17:17:55 +0000 Subject: [Rxtx] Resource temporarily unavailable on writeByte() Message-ID: Hi, This affects rxtx 2.1.7 and 2.2pre2 I have a POS receipt printer connected via parallel port. The BIOS is set to use SPP more for the parallel port. I am sending bytes to the parallel outputstream using the out.write(int b) method and just for safety I call flush after each write.. out.write(b); out.flush(); When I queue up arrays of bytes to be written that way, it will keep printing and then throw a "java.io.IOException: Resource temporarily unavailable in writeByte" all the time. I did a dirty workaround by pausing 2 seconds between printing receipts and it seems to postpone the error from happening, but it still happens. I thought it was maybe a threading problem from my app... so I made a program to just skip all the threading stuff and just print directly. Same problem. The below exception was thrown when using the 2.1.7 version of rxtx java.io.IOException: Resource temporarily unavailable in writeArray com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2381) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) Caused by: Resource temporarily unavailable in writeArray gnu.io.LPRPort.writeArray(Native Method) gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:281) com.gi.pos.comm.parallel.ParallelCommWriter.write(ParallelCommWriter.java:62) com.gi.pos.comm.parallel.ParallelCommWriter.writeString(ParallelCommWriter.java:52) com.gi.pos.comm.POSCommPort.writeString(POSCommPort.java:95) com.gi.resto.printer.RestoPOSPrinter.writeTwoStrings(RestoPOSPrinter.java:3045) com.gi.resto.printer.RestoPOSPrinter.writeCondimentString(RestoPOSPrinter.java:3074) com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2145) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) I've tried everything possible and also, I don't know if this is implemented or not but ParallelPort.isPrinterBusy() always returns false, is this normal? And it seems rxtx setting the parallel mode to EPP or ECP always throws and exception even though my bios supports those modes. Please help, this is frustrating :S -- George H george.dma at gmail.com From thomas.shulok at lmco.com Wed May 19 18:40:38 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Wed, 19 May 2010 18:40:38 -0600 Subject: [Rxtx] lock files, expected behavior? Message-ID: Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 05:05:41 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 20 May 2010 13:05:41 +0200 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, > > > > I know there are a ton of questions about lock files (I think I?ve read all > of them at this point J, but my question is slightly different. In my > application, I initially do a CommPortIdentifier.*getPortIdentifiers*(), > and I get back all my expected com ports. No problem there. Subsequently, > I acquire a port via CommPortIdentifier.*open*(). No problem. But now, > when I do a subsequent CommPortIdentifier.*getPortIdentifiers*(), the port > I acquired is no longer included in the returned enumeration. For the port > in question, the call to getPortIdentifiers produces > > > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File > exists > > > > in the log. Everything I?m doing is in one process space. I?ve confirmed > that my PID and the PID inside the lock file are the same. Does the > implementation check to see if the PID in the lock file is the same as the > PID of the caller, or does it merely check for the existence of the lock > file and bail, regardless of who the caller is? Or am I missing something > else? > > > > Thanks, > > Thom > > (rxtx-2.1.7-r2) > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.shulok at lmco.com Thu May 20 07:43:13 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 20 May 2010 07:43:13 -0600 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Thu May 20 07:44:35 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Thu, 20 May 2010 15:44:35 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Message-ID: Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 07:56:34 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 15:56:34 +0200 Subject: [Rxtx] lock files, expected behavior? References: Message-ID: <81AA8C26A14E43279758AA42434576D9@mdam2> Hi, sorry for previous miss-click :) Shared access to serial ports is very diffucult even if native OS. IMHO this should be done at least in JNI or LOWER/DEEPER in OS, but I don't think that RXTX does it (I am not a developer, only user). So I can only suggest to join Java applications (processes) and sort data inside joined application. Regards Mariusz ----- Original Message ----- From: Shulok, Thomas To: Mariusz Dec Cc: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:43 PM Subject: RE: [Rxtx] lock files, expected behavior? Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point J, but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 08:26:43 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 16:26:43 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver References: Message-ID: <33FE508874504BF4B3A636FCF120D7C0@mdam2> Hi, If you have copied only final jre there is not enough. Installation of the RXTX bins must be compatible with local Java and/or system paths... This is of course theory, because Java is platform independent . In w7-32 there is enough to copy rxtxSerial.dll to Windows/system32 or to Java jre folders something like that: ....Java\jre6\bin\rxtxSerial.dll Regards Mariusz ----- Original Message ----- From: Hans Rupp To: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:44 PM Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu May 20 17:02:09 2010 From: george.dma at gmail.com (George H) Date: Thu, 20 May 2010 23:02:09 +0000 Subject: [Rxtx] Possible bug in ParallelImp.c Message-ID: Hi, I been looking for a reason why .isPrinterBusy() method always returns false for me and I was looking at the ParallelImp.c class and found this #if defined (__linux__) ioctl(fd, LPGETSTATUS, &status); #elif defined (WIN32) I assume this is trying to call the function from ppdev.c in the linux source code, am I right on this? If so then that method does not exist and should be "pp_ioctl" Can someone verify this for me please ? -- George H george.dma at gmail.com From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ra85551 at gmail.com Fri May 14 08:51:34 2010 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Fri, 14 May 2010 18:51:34 +0400 Subject: [Rxtx] problem with compiling RXTX for OpenWrt 10.03 host Message-ID: Hello, I try to compile RXTX for use on OpenWrt box. ./configure --host=mipsel-openwrt-linux --prefix=/home/pavel/rxtx2.2-bin make But I've been got a following error: mipsel-openwrt-linux-gcc -I/home/pavel/rxtx-2.2pre2 -Imipsel-openwrt-linux-gnu -I. -I/opt/java/include -I/opt/java/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/pavel/rxtx-2.2pre2/./src/RawImp.c -fPIC -DPIC -o /home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/.libs/RawImp.o /home/pavel/rxtx-2.2pre2/./src/RawImp.c:104:20: sys/io.h: No such file or directory libtool: link: `/home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/RawImp.lo' is not a valid libtool object I've found no better solution than comment out entire line 104 in src/RawImp.c 104c104 < //#include --- > #include After that compilation has been succeeded. But is this the best way to compile? -- Pavel Parkhomenko From davestechshop at gmail.com Fri May 14 13:08:58 2010 From: davestechshop at gmail.com (Dave) Date: Fri, 14 May 2010 15:08:58 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux Message-ID: Here is some non-technical feedback about rxtx on two platforms. (I'm not a developer.) We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, but it has one problem we can't overcome. Windows: -------------------- 2.2pre2 on Windows crashes when the connected device is turned off or unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. Linux: -------------------- The best way I can explain the 2.2.pre2 problem on Linux is to paste this: "Tell them the read on the inputstream doesn't block, and when you enable the receiveTimeout, it gets forgotten after the first bytes are received [and it cannot be re-asserted]." Workarounds: -------------------- A workaround for the problem is possible on Windows, but we haven't found one for Linux. Our code is doing something that is not done by the example code generous people on this list helped me with. Our code receives many serial input events over 24 hours without intentionally disconnecting. The receiveTimeout problem is only evident after the first data packet is complete and the connection remains open for some time. Furthermore, if the instrument is disconnected, our app needs to wait and reconnect when the instrument becomes available. rxtx 2.2pre2 will not do this (on Windows). However, 2.1.7 will handle the disconnect and recover. The biggest problem for us is 2.2pre2 on Linux because we haven't found any workaround yet. We can't go back to 2.1.7 on Linux either (because it apparently doesn't work). Wish I could say something that would be more meaningful to you guys (especially the devs), but I hope what I have said is of value to someone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 15 00:52:11 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 15 May 2010 08:52:11 +0200 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: 2010/5/14 Dave > Here is some non-technical feedback about rxtx on two platforms. (I'm not a > developer.) > > We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, > but it has one problem we can't overcome. > > Windows: > -------------------- > 2.2pre2 on Windows crashes when the connected device is turned off or > unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. > Hi Dave Sorry - I don't agree with above description - I have had more problems with 2.1.7... I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting USB dongle if I am using software construction shown in my previous examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. Everything is to safelly catch in Java and reconnect! There are several things more while working with system's suspend's as well. I have observed (mainly in W7) that small activity of the COM channel may results in VCP driver deactivation (or somethnig like that). Therefore I have prepared my external device to generate dummy data (SW software version) in declared time intervals. Problems has gone... In Vista there were enough to disable energy saving on USB ports in notebook - this problem wasn't observed on desktop. Regards Mariusz > Linux: > -------------------- > The best way I can explain the 2.2.pre2 problem on Linux is to paste this: > > "Tell them the read on the inputstream doesn't block, and when you enable > the receiveTimeout, it gets forgotten after the first bytes are received > [and it cannot be re-asserted]." > > Workarounds: > -------------------- > A workaround for the problem is possible on Windows, but we haven't found > one for Linux. > > Our code is doing something that is not done by the example code generous > people on this list helped me with. Our code receives many serial input > events over 24 hours without intentionally disconnecting. The receiveTimeout > problem is only evident after the first data packet is complete and the > connection remains open for some time. > > Furthermore, if the instrument is disconnected, our app needs to wait and > reconnect when the instrument becomes available. rxtx 2.2pre2 will not do > this (on Windows). However, 2.1.7 will handle the disconnect and recover. > > The biggest problem for us is 2.2pre2 on Linux because we haven't found any > workaround yet. We can't go back to 2.1.7 on Linux either (because it > apparently doesn't work). > > Wish I could say something that would be more meaningful to you guys > (especially the devs), but I hope what I have said is of value to someone. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Sat May 15 02:30:49 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 08:30:49 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 Message-ID: Hi, I just wanted to know why the parallel port dll for windows is missing in the pre2.2 binary package? Does anyone have it compiled and working? Thanks -- George H george.dma at gmail.com From george.dma at gmail.com Sat May 15 03:33:08 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 09:33:08 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 In-Reply-To: References: Message-ID: On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked?? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > From mariusz.dec at gmail.com Sat May 15 05:38:29 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 15 May 2010 13:38:29 +0200 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 References: Message-ID: <57E4C18871C249EC82846512B38F121D@mdam2> Hi, I have just compiled it, but my RXTX 2.2 pre hasn't last CVS's. Do you have any FTP? Many mail relay servers blocks mails with dll's. Regards Mariusz ----- Original Message ----- From: "George H" To: "rxtx" Sent: Saturday, May 15, 2010 11:33 AM Subject: Re: [Rxtx] ParallelPort dll missing for windows in pre2.2 On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From davestechshop at gmail.com Sat May 15 15:04:02 2010 From: davestechshop at gmail.com (Dave) Date: Sat, 15 May 2010 17:04:02 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: Your example code was very, very helpful. However, the developer told me that your example code does not test the scenarios we are encountering. I'll see if I can get him to post a little more info. Sorry I don't have more to add at this time. Dave On Sat, May 15, 2010 at 2:52 AM, Mariusz Dec wrote: > > > 2010/5/14 Dave > > Here is some non-technical feedback about rxtx on two platforms. (I'm not a >> developer.) >> >> We can't get 2.2pre2 to work reliably on Windows. It works better on >> Linux, but it has one problem we can't overcome. >> >> Windows: >> -------------------- >> 2.2pre2 on Windows crashes when the connected device is turned off or >> unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. >> > > Hi Dave > > Sorry - I don't agree with above description - I have had more problems > with 2.1.7... > > I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting > USB dongle if I am using software construction shown in my previous > examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. > Everything is to safelly catch in Java and reconnect! > > There are several things more while working with system's suspend's as > well. > > I have observed (mainly in W7) that small activity of the COM channel may > results in VCP driver deactivation (or somethnig like that). > Therefore I have prepared my external device to generate dummy data (SW > software version) in declared time intervals. > Problems has gone... > In Vista there were enough to disable energy saving on USB ports in > notebook - this problem wasn't observed on desktop. > > > Regards > Mariusz > > >> Linux: >> -------------------- >> The best way I can explain the 2.2.pre2 problem on Linux is to paste this: >> >> "Tell them the read on the inputstream doesn't block, and when you enable >> the receiveTimeout, it gets forgotten after the first bytes are received >> [and it cannot be re-asserted]." >> >> Workarounds: >> -------------------- >> A workaround for the problem is possible on Windows, but we haven't found >> one for Linux. >> >> Our code is doing something that is not done by the example code generous >> people on this list helped me with. Our code receives many serial input >> events over 24 hours without intentionally disconnecting. The receiveTimeout >> problem is only evident after the first data packet is complete and the >> connection remains open for some time. >> >> Furthermore, if the instrument is disconnected, our app needs to wait and >> reconnect when the instrument becomes available. rxtx 2.2pre2 will not do >> this (on Windows). However, 2.1.7 will handle the disconnect and recover. >> >> The biggest problem for us is 2.2pre2 on Linux because we haven't found >> any workaround yet. We can't go back to 2.1.7 on Linux either (because it >> apparently doesn't work). >> >> Wish I could say something that would be more meaningful to you guys >> (especially the devs), but I hope what I have said is of value to someone. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon May 17 08:36:43 2010 From: george.dma at gmail.com (George H) Date: Mon, 17 May 2010 14:36:43 +0000 Subject: [Rxtx] Printing hangs when sending data to parallel port Message-ID: Hi, I am getting a really weird and annoying problem and I have exhausted all options. I am using rxtx pre2.2 on linux. I am connecting to a receipt printer on a parallel port (/dev/lp0) The receipt printer has a 4.0Kb data buffer Here's the problem. In my java program when I send it bytes (and I do a .flush() after each invocation of .write(byte[])) it prints the data but stops arbitrarily during the print process. I wait a bit... re-send the data to get printed. 1 out of 3 times it succeeds and prints everything. But with long data it has problems. Now here is the weird part. I create a text file with 7Kb of text data. I run the command "cat test.txt > /dev/lp0" and the printer prints everything in 1 go without any problems. So I don't know, I am thinking maybe this is a problem with rxtx ? maybe I need to set some parallel parameters? Or should I try reverting to the 2.1 version of rxtx if the parallel code is more reliable? Thanks for helping -- George H george.dma at gmail.com From george.dma at gmail.com Tue May 18 00:16:54 2010 From: george.dma at gmail.com (George H) Date: Tue, 18 May 2010 09:16:54 +0300 Subject: [Rxtx] Printing hangs when sending data to parallel port In-Reply-To: References: Message-ID: On Mon, May 17, 2010 at 5:36 PM, George H wrote: > Hi, > > I am getting a really weird and annoying problem and I have exhausted > all options. I am using rxtx pre2.2 on linux. > I am connecting to a receipt printer on a parallel port (/dev/lp0) The > receipt printer has a 4.0Kb data buffer > > Here's the problem. In my java program when I send it bytes (and I do > a .flush() after each invocation of .write(byte[])) it prints the data > but stops arbitrarily during the print process. I wait a bit... > re-send the data to get printed. 1 out of 3 times it succeeds and > prints everything. But with long data it has problems. > > Now here is the weird part. I create a text file with 7Kb of text > data. I run the command ? "cat test.txt > /dev/lp0" and the printer > prints everything in 1 go without any problems. > > So I don't know, I am thinking maybe this is a problem with rxtx ? > maybe I need to set some parallel parameters? Or should I try > reverting to the 2.1 version of rxtx if the parallel code is more > reliable? > > Thanks for helping After testing we found out that we need to send the text to the printer as UTF8 bytes and best to include a 50ms blocking parameter when connecting to the parallel port. So I'm glad to say that rxtx was not the problem, just me not knowing the above were a requirement. > > -- > George H > george.dma at gmail.com > From george.dma at gmail.com Wed May 19 11:17:55 2010 From: george.dma at gmail.com (George H) Date: Wed, 19 May 2010 17:17:55 +0000 Subject: [Rxtx] Resource temporarily unavailable on writeByte() Message-ID: Hi, This affects rxtx 2.1.7 and 2.2pre2 I have a POS receipt printer connected via parallel port. The BIOS is set to use SPP more for the parallel port. I am sending bytes to the parallel outputstream using the out.write(int b) method and just for safety I call flush after each write.. out.write(b); out.flush(); When I queue up arrays of bytes to be written that way, it will keep printing and then throw a "java.io.IOException: Resource temporarily unavailable in writeByte" all the time. I did a dirty workaround by pausing 2 seconds between printing receipts and it seems to postpone the error from happening, but it still happens. I thought it was maybe a threading problem from my app... so I made a program to just skip all the threading stuff and just print directly. Same problem. The below exception was thrown when using the 2.1.7 version of rxtx java.io.IOException: Resource temporarily unavailable in writeArray com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2381) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) Caused by: Resource temporarily unavailable in writeArray gnu.io.LPRPort.writeArray(Native Method) gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:281) com.gi.pos.comm.parallel.ParallelCommWriter.write(ParallelCommWriter.java:62) com.gi.pos.comm.parallel.ParallelCommWriter.writeString(ParallelCommWriter.java:52) com.gi.pos.comm.POSCommPort.writeString(POSCommPort.java:95) com.gi.resto.printer.RestoPOSPrinter.writeTwoStrings(RestoPOSPrinter.java:3045) com.gi.resto.printer.RestoPOSPrinter.writeCondimentString(RestoPOSPrinter.java:3074) com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2145) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) I've tried everything possible and also, I don't know if this is implemented or not but ParallelPort.isPrinterBusy() always returns false, is this normal? And it seems rxtx setting the parallel mode to EPP or ECP always throws and exception even though my bios supports those modes. Please help, this is frustrating :S -- George H george.dma at gmail.com From thomas.shulok at lmco.com Wed May 19 18:40:38 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Wed, 19 May 2010 18:40:38 -0600 Subject: [Rxtx] lock files, expected behavior? Message-ID: Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 05:05:41 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 20 May 2010 13:05:41 +0200 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, > > > > I know there are a ton of questions about lock files (I think I?ve read all > of them at this point J, but my question is slightly different. In my > application, I initially do a CommPortIdentifier.*getPortIdentifiers*(), > and I get back all my expected com ports. No problem there. Subsequently, > I acquire a port via CommPortIdentifier.*open*(). No problem. But now, > when I do a subsequent CommPortIdentifier.*getPortIdentifiers*(), the port > I acquired is no longer included in the returned enumeration. For the port > in question, the call to getPortIdentifiers produces > > > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File > exists > > > > in the log. Everything I?m doing is in one process space. I?ve confirmed > that my PID and the PID inside the lock file are the same. Does the > implementation check to see if the PID in the lock file is the same as the > PID of the caller, or does it merely check for the existence of the lock > file and bail, regardless of who the caller is? Or am I missing something > else? > > > > Thanks, > > Thom > > (rxtx-2.1.7-r2) > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.shulok at lmco.com Thu May 20 07:43:13 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 20 May 2010 07:43:13 -0600 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Thu May 20 07:44:35 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Thu, 20 May 2010 15:44:35 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Message-ID: Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 07:56:34 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 15:56:34 +0200 Subject: [Rxtx] lock files, expected behavior? References: Message-ID: <81AA8C26A14E43279758AA42434576D9@mdam2> Hi, sorry for previous miss-click :) Shared access to serial ports is very diffucult even if native OS. IMHO this should be done at least in JNI or LOWER/DEEPER in OS, but I don't think that RXTX does it (I am not a developer, only user). So I can only suggest to join Java applications (processes) and sort data inside joined application. Regards Mariusz ----- Original Message ----- From: Shulok, Thomas To: Mariusz Dec Cc: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:43 PM Subject: RE: [Rxtx] lock files, expected behavior? Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point J, but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 08:26:43 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 16:26:43 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver References: Message-ID: <33FE508874504BF4B3A636FCF120D7C0@mdam2> Hi, If you have copied only final jre there is not enough. Installation of the RXTX bins must be compatible with local Java and/or system paths... This is of course theory, because Java is platform independent . In w7-32 there is enough to copy rxtxSerial.dll to Windows/system32 or to Java jre folders something like that: ....Java\jre6\bin\rxtxSerial.dll Regards Mariusz ----- Original Message ----- From: Hans Rupp To: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:44 PM Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu May 20 17:02:09 2010 From: george.dma at gmail.com (George H) Date: Thu, 20 May 2010 23:02:09 +0000 Subject: [Rxtx] Possible bug in ParallelImp.c Message-ID: Hi, I been looking for a reason why .isPrinterBusy() method always returns false for me and I was looking at the ParallelImp.c class and found this #if defined (__linux__) ioctl(fd, LPGETSTATUS, &status); #elif defined (WIN32) I assume this is trying to call the function from ppdev.c in the linux source code, am I right on this? If so then that method does not exist and should be "pp_ioctl" Can someone verify this for me please ? -- George H george.dma at gmail.com From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ra85551 at gmail.com Fri May 14 08:51:34 2010 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Fri, 14 May 2010 18:51:34 +0400 Subject: [Rxtx] problem with compiling RXTX for OpenWrt 10.03 host Message-ID: Hello, I try to compile RXTX for use on OpenWrt box. ./configure --host=mipsel-openwrt-linux --prefix=/home/pavel/rxtx2.2-bin make But I've been got a following error: mipsel-openwrt-linux-gcc -I/home/pavel/rxtx-2.2pre2 -Imipsel-openwrt-linux-gnu -I. -I/opt/java/include -I/opt/java/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/pavel/rxtx-2.2pre2/./src/RawImp.c -fPIC -DPIC -o /home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/.libs/RawImp.o /home/pavel/rxtx-2.2pre2/./src/RawImp.c:104:20: sys/io.h: No such file or directory libtool: link: `/home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/RawImp.lo' is not a valid libtool object I've found no better solution than comment out entire line 104 in src/RawImp.c 104c104 < //#include --- > #include After that compilation has been succeeded. But is this the best way to compile? -- Pavel Parkhomenko From davestechshop at gmail.com Fri May 14 13:08:58 2010 From: davestechshop at gmail.com (Dave) Date: Fri, 14 May 2010 15:08:58 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux Message-ID: Here is some non-technical feedback about rxtx on two platforms. (I'm not a developer.) We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, but it has one problem we can't overcome. Windows: -------------------- 2.2pre2 on Windows crashes when the connected device is turned off or unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. Linux: -------------------- The best way I can explain the 2.2.pre2 problem on Linux is to paste this: "Tell them the read on the inputstream doesn't block, and when you enable the receiveTimeout, it gets forgotten after the first bytes are received [and it cannot be re-asserted]." Workarounds: -------------------- A workaround for the problem is possible on Windows, but we haven't found one for Linux. Our code is doing something that is not done by the example code generous people on this list helped me with. Our code receives many serial input events over 24 hours without intentionally disconnecting. The receiveTimeout problem is only evident after the first data packet is complete and the connection remains open for some time. Furthermore, if the instrument is disconnected, our app needs to wait and reconnect when the instrument becomes available. rxtx 2.2pre2 will not do this (on Windows). However, 2.1.7 will handle the disconnect and recover. The biggest problem for us is 2.2pre2 on Linux because we haven't found any workaround yet. We can't go back to 2.1.7 on Linux either (because it apparently doesn't work). Wish I could say something that would be more meaningful to you guys (especially the devs), but I hope what I have said is of value to someone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 15 00:52:11 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 15 May 2010 08:52:11 +0200 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: 2010/5/14 Dave > Here is some non-technical feedback about rxtx on two platforms. (I'm not a > developer.) > > We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, > but it has one problem we can't overcome. > > Windows: > -------------------- > 2.2pre2 on Windows crashes when the connected device is turned off or > unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. > Hi Dave Sorry - I don't agree with above description - I have had more problems with 2.1.7... I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting USB dongle if I am using software construction shown in my previous examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. Everything is to safelly catch in Java and reconnect! There are several things more while working with system's suspend's as well. I have observed (mainly in W7) that small activity of the COM channel may results in VCP driver deactivation (or somethnig like that). Therefore I have prepared my external device to generate dummy data (SW software version) in declared time intervals. Problems has gone... In Vista there were enough to disable energy saving on USB ports in notebook - this problem wasn't observed on desktop. Regards Mariusz > Linux: > -------------------- > The best way I can explain the 2.2.pre2 problem on Linux is to paste this: > > "Tell them the read on the inputstream doesn't block, and when you enable > the receiveTimeout, it gets forgotten after the first bytes are received > [and it cannot be re-asserted]." > > Workarounds: > -------------------- > A workaround for the problem is possible on Windows, but we haven't found > one for Linux. > > Our code is doing something that is not done by the example code generous > people on this list helped me with. Our code receives many serial input > events over 24 hours without intentionally disconnecting. The receiveTimeout > problem is only evident after the first data packet is complete and the > connection remains open for some time. > > Furthermore, if the instrument is disconnected, our app needs to wait and > reconnect when the instrument becomes available. rxtx 2.2pre2 will not do > this (on Windows). However, 2.1.7 will handle the disconnect and recover. > > The biggest problem for us is 2.2pre2 on Linux because we haven't found any > workaround yet. We can't go back to 2.1.7 on Linux either (because it > apparently doesn't work). > > Wish I could say something that would be more meaningful to you guys > (especially the devs), but I hope what I have said is of value to someone. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Sat May 15 02:30:49 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 08:30:49 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 Message-ID: Hi, I just wanted to know why the parallel port dll for windows is missing in the pre2.2 binary package? Does anyone have it compiled and working? Thanks -- George H george.dma at gmail.com From george.dma at gmail.com Sat May 15 03:33:08 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 09:33:08 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 In-Reply-To: References: Message-ID: On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked?? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > From mariusz.dec at gmail.com Sat May 15 05:38:29 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 15 May 2010 13:38:29 +0200 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 References: Message-ID: <57E4C18871C249EC82846512B38F121D@mdam2> Hi, I have just compiled it, but my RXTX 2.2 pre hasn't last CVS's. Do you have any FTP? Many mail relay servers blocks mails with dll's. Regards Mariusz ----- Original Message ----- From: "George H" To: "rxtx" Sent: Saturday, May 15, 2010 11:33 AM Subject: Re: [Rxtx] ParallelPort dll missing for windows in pre2.2 On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From davestechshop at gmail.com Sat May 15 15:04:02 2010 From: davestechshop at gmail.com (Dave) Date: Sat, 15 May 2010 17:04:02 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: Your example code was very, very helpful. However, the developer told me that your example code does not test the scenarios we are encountering. I'll see if I can get him to post a little more info. Sorry I don't have more to add at this time. Dave On Sat, May 15, 2010 at 2:52 AM, Mariusz Dec wrote: > > > 2010/5/14 Dave > > Here is some non-technical feedback about rxtx on two platforms. (I'm not a >> developer.) >> >> We can't get 2.2pre2 to work reliably on Windows. It works better on >> Linux, but it has one problem we can't overcome. >> >> Windows: >> -------------------- >> 2.2pre2 on Windows crashes when the connected device is turned off or >> unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. >> > > Hi Dave > > Sorry - I don't agree with above description - I have had more problems > with 2.1.7... > > I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting > USB dongle if I am using software construction shown in my previous > examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. > Everything is to safelly catch in Java and reconnect! > > There are several things more while working with system's suspend's as > well. > > I have observed (mainly in W7) that small activity of the COM channel may > results in VCP driver deactivation (or somethnig like that). > Therefore I have prepared my external device to generate dummy data (SW > software version) in declared time intervals. > Problems has gone... > In Vista there were enough to disable energy saving on USB ports in > notebook - this problem wasn't observed on desktop. > > > Regards > Mariusz > > >> Linux: >> -------------------- >> The best way I can explain the 2.2.pre2 problem on Linux is to paste this: >> >> "Tell them the read on the inputstream doesn't block, and when you enable >> the receiveTimeout, it gets forgotten after the first bytes are received >> [and it cannot be re-asserted]." >> >> Workarounds: >> -------------------- >> A workaround for the problem is possible on Windows, but we haven't found >> one for Linux. >> >> Our code is doing something that is not done by the example code generous >> people on this list helped me with. Our code receives many serial input >> events over 24 hours without intentionally disconnecting. The receiveTimeout >> problem is only evident after the first data packet is complete and the >> connection remains open for some time. >> >> Furthermore, if the instrument is disconnected, our app needs to wait and >> reconnect when the instrument becomes available. rxtx 2.2pre2 will not do >> this (on Windows). However, 2.1.7 will handle the disconnect and recover. >> >> The biggest problem for us is 2.2pre2 on Linux because we haven't found >> any workaround yet. We can't go back to 2.1.7 on Linux either (because it >> apparently doesn't work). >> >> Wish I could say something that would be more meaningful to you guys >> (especially the devs), but I hope what I have said is of value to someone. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon May 17 08:36:43 2010 From: george.dma at gmail.com (George H) Date: Mon, 17 May 2010 14:36:43 +0000 Subject: [Rxtx] Printing hangs when sending data to parallel port Message-ID: Hi, I am getting a really weird and annoying problem and I have exhausted all options. I am using rxtx pre2.2 on linux. I am connecting to a receipt printer on a parallel port (/dev/lp0) The receipt printer has a 4.0Kb data buffer Here's the problem. In my java program when I send it bytes (and I do a .flush() after each invocation of .write(byte[])) it prints the data but stops arbitrarily during the print process. I wait a bit... re-send the data to get printed. 1 out of 3 times it succeeds and prints everything. But with long data it has problems. Now here is the weird part. I create a text file with 7Kb of text data. I run the command "cat test.txt > /dev/lp0" and the printer prints everything in 1 go without any problems. So I don't know, I am thinking maybe this is a problem with rxtx ? maybe I need to set some parallel parameters? Or should I try reverting to the 2.1 version of rxtx if the parallel code is more reliable? Thanks for helping -- George H george.dma at gmail.com From george.dma at gmail.com Tue May 18 00:16:54 2010 From: george.dma at gmail.com (George H) Date: Tue, 18 May 2010 09:16:54 +0300 Subject: [Rxtx] Printing hangs when sending data to parallel port In-Reply-To: References: Message-ID: On Mon, May 17, 2010 at 5:36 PM, George H wrote: > Hi, > > I am getting a really weird and annoying problem and I have exhausted > all options. I am using rxtx pre2.2 on linux. > I am connecting to a receipt printer on a parallel port (/dev/lp0) The > receipt printer has a 4.0Kb data buffer > > Here's the problem. In my java program when I send it bytes (and I do > a .flush() after each invocation of .write(byte[])) it prints the data > but stops arbitrarily during the print process. I wait a bit... > re-send the data to get printed. 1 out of 3 times it succeeds and > prints everything. But with long data it has problems. > > Now here is the weird part. I create a text file with 7Kb of text > data. I run the command ? "cat test.txt > /dev/lp0" and the printer > prints everything in 1 go without any problems. > > So I don't know, I am thinking maybe this is a problem with rxtx ? > maybe I need to set some parallel parameters? Or should I try > reverting to the 2.1 version of rxtx if the parallel code is more > reliable? > > Thanks for helping After testing we found out that we need to send the text to the printer as UTF8 bytes and best to include a 50ms blocking parameter when connecting to the parallel port. So I'm glad to say that rxtx was not the problem, just me not knowing the above were a requirement. > > -- > George H > george.dma at gmail.com > From george.dma at gmail.com Wed May 19 11:17:55 2010 From: george.dma at gmail.com (George H) Date: Wed, 19 May 2010 17:17:55 +0000 Subject: [Rxtx] Resource temporarily unavailable on writeByte() Message-ID: Hi, This affects rxtx 2.1.7 and 2.2pre2 I have a POS receipt printer connected via parallel port. The BIOS is set to use SPP more for the parallel port. I am sending bytes to the parallel outputstream using the out.write(int b) method and just for safety I call flush after each write.. out.write(b); out.flush(); When I queue up arrays of bytes to be written that way, it will keep printing and then throw a "java.io.IOException: Resource temporarily unavailable in writeByte" all the time. I did a dirty workaround by pausing 2 seconds between printing receipts and it seems to postpone the error from happening, but it still happens. I thought it was maybe a threading problem from my app... so I made a program to just skip all the threading stuff and just print directly. Same problem. The below exception was thrown when using the 2.1.7 version of rxtx java.io.IOException: Resource temporarily unavailable in writeArray com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2381) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) Caused by: Resource temporarily unavailable in writeArray gnu.io.LPRPort.writeArray(Native Method) gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:281) com.gi.pos.comm.parallel.ParallelCommWriter.write(ParallelCommWriter.java:62) com.gi.pos.comm.parallel.ParallelCommWriter.writeString(ParallelCommWriter.java:52) com.gi.pos.comm.POSCommPort.writeString(POSCommPort.java:95) com.gi.resto.printer.RestoPOSPrinter.writeTwoStrings(RestoPOSPrinter.java:3045) com.gi.resto.printer.RestoPOSPrinter.writeCondimentString(RestoPOSPrinter.java:3074) com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2145) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) I've tried everything possible and also, I don't know if this is implemented or not but ParallelPort.isPrinterBusy() always returns false, is this normal? And it seems rxtx setting the parallel mode to EPP or ECP always throws and exception even though my bios supports those modes. Please help, this is frustrating :S -- George H george.dma at gmail.com From thomas.shulok at lmco.com Wed May 19 18:40:38 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Wed, 19 May 2010 18:40:38 -0600 Subject: [Rxtx] lock files, expected behavior? Message-ID: Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 05:05:41 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 20 May 2010 13:05:41 +0200 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, > > > > I know there are a ton of questions about lock files (I think I?ve read all > of them at this point J, but my question is slightly different. In my > application, I initially do a CommPortIdentifier.*getPortIdentifiers*(), > and I get back all my expected com ports. No problem there. Subsequently, > I acquire a port via CommPortIdentifier.*open*(). No problem. But now, > when I do a subsequent CommPortIdentifier.*getPortIdentifiers*(), the port > I acquired is no longer included in the returned enumeration. For the port > in question, the call to getPortIdentifiers produces > > > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File > exists > > > > in the log. Everything I?m doing is in one process space. I?ve confirmed > that my PID and the PID inside the lock file are the same. Does the > implementation check to see if the PID in the lock file is the same as the > PID of the caller, or does it merely check for the existence of the lock > file and bail, regardless of who the caller is? Or am I missing something > else? > > > > Thanks, > > Thom > > (rxtx-2.1.7-r2) > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.shulok at lmco.com Thu May 20 07:43:13 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 20 May 2010 07:43:13 -0600 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Thu May 20 07:44:35 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Thu, 20 May 2010 15:44:35 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Message-ID: Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 07:56:34 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 15:56:34 +0200 Subject: [Rxtx] lock files, expected behavior? References: Message-ID: <81AA8C26A14E43279758AA42434576D9@mdam2> Hi, sorry for previous miss-click :) Shared access to serial ports is very diffucult even if native OS. IMHO this should be done at least in JNI or LOWER/DEEPER in OS, but I don't think that RXTX does it (I am not a developer, only user). So I can only suggest to join Java applications (processes) and sort data inside joined application. Regards Mariusz ----- Original Message ----- From: Shulok, Thomas To: Mariusz Dec Cc: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:43 PM Subject: RE: [Rxtx] lock files, expected behavior? Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point J, but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 08:26:43 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 16:26:43 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver References: Message-ID: <33FE508874504BF4B3A636FCF120D7C0@mdam2> Hi, If you have copied only final jre there is not enough. Installation of the RXTX bins must be compatible with local Java and/or system paths... This is of course theory, because Java is platform independent . In w7-32 there is enough to copy rxtxSerial.dll to Windows/system32 or to Java jre folders something like that: ....Java\jre6\bin\rxtxSerial.dll Regards Mariusz ----- Original Message ----- From: Hans Rupp To: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:44 PM Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu May 20 17:02:09 2010 From: george.dma at gmail.com (George H) Date: Thu, 20 May 2010 23:02:09 +0000 Subject: [Rxtx] Possible bug in ParallelImp.c Message-ID: Hi, I been looking for a reason why .isPrinterBusy() method always returns false for me and I was looking at the ParallelImp.c class and found this #if defined (__linux__) ioctl(fd, LPGETSTATUS, &status); #elif defined (WIN32) I assume this is trying to call the function from ppdev.c in the linux source code, am I right on this? If so then that method does not exist and should be "pp_ioctl" Can someone verify this for me please ? -- George H george.dma at gmail.com From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ra85551 at gmail.com Fri May 14 08:51:34 2010 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Fri, 14 May 2010 18:51:34 +0400 Subject: [Rxtx] problem with compiling RXTX for OpenWrt 10.03 host Message-ID: Hello, I try to compile RXTX for use on OpenWrt box. ./configure --host=mipsel-openwrt-linux --prefix=/home/pavel/rxtx2.2-bin make But I've been got a following error: mipsel-openwrt-linux-gcc -I/home/pavel/rxtx-2.2pre2 -Imipsel-openwrt-linux-gnu -I. -I/opt/java/include -I/opt/java/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/pavel/rxtx-2.2pre2/./src/RawImp.c -fPIC -DPIC -o /home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/.libs/RawImp.o /home/pavel/rxtx-2.2pre2/./src/RawImp.c:104:20: sys/io.h: No such file or directory libtool: link: `/home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/RawImp.lo' is not a valid libtool object I've found no better solution than comment out entire line 104 in src/RawImp.c 104c104 < //#include --- > #include After that compilation has been succeeded. But is this the best way to compile? -- Pavel Parkhomenko From davestechshop at gmail.com Fri May 14 13:08:58 2010 From: davestechshop at gmail.com (Dave) Date: Fri, 14 May 2010 15:08:58 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux Message-ID: Here is some non-technical feedback about rxtx on two platforms. (I'm not a developer.) We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, but it has one problem we can't overcome. Windows: -------------------- 2.2pre2 on Windows crashes when the connected device is turned off or unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. Linux: -------------------- The best way I can explain the 2.2.pre2 problem on Linux is to paste this: "Tell them the read on the inputstream doesn't block, and when you enable the receiveTimeout, it gets forgotten after the first bytes are received [and it cannot be re-asserted]." Workarounds: -------------------- A workaround for the problem is possible on Windows, but we haven't found one for Linux. Our code is doing something that is not done by the example code generous people on this list helped me with. Our code receives many serial input events over 24 hours without intentionally disconnecting. The receiveTimeout problem is only evident after the first data packet is complete and the connection remains open for some time. Furthermore, if the instrument is disconnected, our app needs to wait and reconnect when the instrument becomes available. rxtx 2.2pre2 will not do this (on Windows). However, 2.1.7 will handle the disconnect and recover. The biggest problem for us is 2.2pre2 on Linux because we haven't found any workaround yet. We can't go back to 2.1.7 on Linux either (because it apparently doesn't work). Wish I could say something that would be more meaningful to you guys (especially the devs), but I hope what I have said is of value to someone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 15 00:52:11 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 15 May 2010 08:52:11 +0200 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: 2010/5/14 Dave > Here is some non-technical feedback about rxtx on two platforms. (I'm not a > developer.) > > We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, > but it has one problem we can't overcome. > > Windows: > -------------------- > 2.2pre2 on Windows crashes when the connected device is turned off or > unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. > Hi Dave Sorry - I don't agree with above description - I have had more problems with 2.1.7... I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting USB dongle if I am using software construction shown in my previous examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. Everything is to safelly catch in Java and reconnect! There are several things more while working with system's suspend's as well. I have observed (mainly in W7) that small activity of the COM channel may results in VCP driver deactivation (or somethnig like that). Therefore I have prepared my external device to generate dummy data (SW software version) in declared time intervals. Problems has gone... In Vista there were enough to disable energy saving on USB ports in notebook - this problem wasn't observed on desktop. Regards Mariusz > Linux: > -------------------- > The best way I can explain the 2.2.pre2 problem on Linux is to paste this: > > "Tell them the read on the inputstream doesn't block, and when you enable > the receiveTimeout, it gets forgotten after the first bytes are received > [and it cannot be re-asserted]." > > Workarounds: > -------------------- > A workaround for the problem is possible on Windows, but we haven't found > one for Linux. > > Our code is doing something that is not done by the example code generous > people on this list helped me with. Our code receives many serial input > events over 24 hours without intentionally disconnecting. The receiveTimeout > problem is only evident after the first data packet is complete and the > connection remains open for some time. > > Furthermore, if the instrument is disconnected, our app needs to wait and > reconnect when the instrument becomes available. rxtx 2.2pre2 will not do > this (on Windows). However, 2.1.7 will handle the disconnect and recover. > > The biggest problem for us is 2.2pre2 on Linux because we haven't found any > workaround yet. We can't go back to 2.1.7 on Linux either (because it > apparently doesn't work). > > Wish I could say something that would be more meaningful to you guys > (especially the devs), but I hope what I have said is of value to someone. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Sat May 15 02:30:49 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 08:30:49 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 Message-ID: Hi, I just wanted to know why the parallel port dll for windows is missing in the pre2.2 binary package? Does anyone have it compiled and working? Thanks -- George H george.dma at gmail.com From george.dma at gmail.com Sat May 15 03:33:08 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 09:33:08 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 In-Reply-To: References: Message-ID: On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked?? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > From mariusz.dec at gmail.com Sat May 15 05:38:29 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 15 May 2010 13:38:29 +0200 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 References: Message-ID: <57E4C18871C249EC82846512B38F121D@mdam2> Hi, I have just compiled it, but my RXTX 2.2 pre hasn't last CVS's. Do you have any FTP? Many mail relay servers blocks mails with dll's. Regards Mariusz ----- Original Message ----- From: "George H" To: "rxtx" Sent: Saturday, May 15, 2010 11:33 AM Subject: Re: [Rxtx] ParallelPort dll missing for windows in pre2.2 On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From davestechshop at gmail.com Sat May 15 15:04:02 2010 From: davestechshop at gmail.com (Dave) Date: Sat, 15 May 2010 17:04:02 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: Your example code was very, very helpful. However, the developer told me that your example code does not test the scenarios we are encountering. I'll see if I can get him to post a little more info. Sorry I don't have more to add at this time. Dave On Sat, May 15, 2010 at 2:52 AM, Mariusz Dec wrote: > > > 2010/5/14 Dave > > Here is some non-technical feedback about rxtx on two platforms. (I'm not a >> developer.) >> >> We can't get 2.2pre2 to work reliably on Windows. It works better on >> Linux, but it has one problem we can't overcome. >> >> Windows: >> -------------------- >> 2.2pre2 on Windows crashes when the connected device is turned off or >> unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. >> > > Hi Dave > > Sorry - I don't agree with above description - I have had more problems > with 2.1.7... > > I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting > USB dongle if I am using software construction shown in my previous > examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. > Everything is to safelly catch in Java and reconnect! > > There are several things more while working with system's suspend's as > well. > > I have observed (mainly in W7) that small activity of the COM channel may > results in VCP driver deactivation (or somethnig like that). > Therefore I have prepared my external device to generate dummy data (SW > software version) in declared time intervals. > Problems has gone... > In Vista there were enough to disable energy saving on USB ports in > notebook - this problem wasn't observed on desktop. > > > Regards > Mariusz > > >> Linux: >> -------------------- >> The best way I can explain the 2.2.pre2 problem on Linux is to paste this: >> >> "Tell them the read on the inputstream doesn't block, and when you enable >> the receiveTimeout, it gets forgotten after the first bytes are received >> [and it cannot be re-asserted]." >> >> Workarounds: >> -------------------- >> A workaround for the problem is possible on Windows, but we haven't found >> one for Linux. >> >> Our code is doing something that is not done by the example code generous >> people on this list helped me with. Our code receives many serial input >> events over 24 hours without intentionally disconnecting. The receiveTimeout >> problem is only evident after the first data packet is complete and the >> connection remains open for some time. >> >> Furthermore, if the instrument is disconnected, our app needs to wait and >> reconnect when the instrument becomes available. rxtx 2.2pre2 will not do >> this (on Windows). However, 2.1.7 will handle the disconnect and recover. >> >> The biggest problem for us is 2.2pre2 on Linux because we haven't found >> any workaround yet. We can't go back to 2.1.7 on Linux either (because it >> apparently doesn't work). >> >> Wish I could say something that would be more meaningful to you guys >> (especially the devs), but I hope what I have said is of value to someone. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon May 17 08:36:43 2010 From: george.dma at gmail.com (George H) Date: Mon, 17 May 2010 14:36:43 +0000 Subject: [Rxtx] Printing hangs when sending data to parallel port Message-ID: Hi, I am getting a really weird and annoying problem and I have exhausted all options. I am using rxtx pre2.2 on linux. I am connecting to a receipt printer on a parallel port (/dev/lp0) The receipt printer has a 4.0Kb data buffer Here's the problem. In my java program when I send it bytes (and I do a .flush() after each invocation of .write(byte[])) it prints the data but stops arbitrarily during the print process. I wait a bit... re-send the data to get printed. 1 out of 3 times it succeeds and prints everything. But with long data it has problems. Now here is the weird part. I create a text file with 7Kb of text data. I run the command "cat test.txt > /dev/lp0" and the printer prints everything in 1 go without any problems. So I don't know, I am thinking maybe this is a problem with rxtx ? maybe I need to set some parallel parameters? Or should I try reverting to the 2.1 version of rxtx if the parallel code is more reliable? Thanks for helping -- George H george.dma at gmail.com From george.dma at gmail.com Tue May 18 00:16:54 2010 From: george.dma at gmail.com (George H) Date: Tue, 18 May 2010 09:16:54 +0300 Subject: [Rxtx] Printing hangs when sending data to parallel port In-Reply-To: References: Message-ID: On Mon, May 17, 2010 at 5:36 PM, George H wrote: > Hi, > > I am getting a really weird and annoying problem and I have exhausted > all options. I am using rxtx pre2.2 on linux. > I am connecting to a receipt printer on a parallel port (/dev/lp0) The > receipt printer has a 4.0Kb data buffer > > Here's the problem. In my java program when I send it bytes (and I do > a .flush() after each invocation of .write(byte[])) it prints the data > but stops arbitrarily during the print process. I wait a bit... > re-send the data to get printed. 1 out of 3 times it succeeds and > prints everything. But with long data it has problems. > > Now here is the weird part. I create a text file with 7Kb of text > data. I run the command ? "cat test.txt > /dev/lp0" and the printer > prints everything in 1 go without any problems. > > So I don't know, I am thinking maybe this is a problem with rxtx ? > maybe I need to set some parallel parameters? Or should I try > reverting to the 2.1 version of rxtx if the parallel code is more > reliable? > > Thanks for helping After testing we found out that we need to send the text to the printer as UTF8 bytes and best to include a 50ms blocking parameter when connecting to the parallel port. So I'm glad to say that rxtx was not the problem, just me not knowing the above were a requirement. > > -- > George H > george.dma at gmail.com > From george.dma at gmail.com Wed May 19 11:17:55 2010 From: george.dma at gmail.com (George H) Date: Wed, 19 May 2010 17:17:55 +0000 Subject: [Rxtx] Resource temporarily unavailable on writeByte() Message-ID: Hi, This affects rxtx 2.1.7 and 2.2pre2 I have a POS receipt printer connected via parallel port. The BIOS is set to use SPP more for the parallel port. I am sending bytes to the parallel outputstream using the out.write(int b) method and just for safety I call flush after each write.. out.write(b); out.flush(); When I queue up arrays of bytes to be written that way, it will keep printing and then throw a "java.io.IOException: Resource temporarily unavailable in writeByte" all the time. I did a dirty workaround by pausing 2 seconds between printing receipts and it seems to postpone the error from happening, but it still happens. I thought it was maybe a threading problem from my app... so I made a program to just skip all the threading stuff and just print directly. Same problem. The below exception was thrown when using the 2.1.7 version of rxtx java.io.IOException: Resource temporarily unavailable in writeArray com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2381) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) Caused by: Resource temporarily unavailable in writeArray gnu.io.LPRPort.writeArray(Native Method) gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:281) com.gi.pos.comm.parallel.ParallelCommWriter.write(ParallelCommWriter.java:62) com.gi.pos.comm.parallel.ParallelCommWriter.writeString(ParallelCommWriter.java:52) com.gi.pos.comm.POSCommPort.writeString(POSCommPort.java:95) com.gi.resto.printer.RestoPOSPrinter.writeTwoStrings(RestoPOSPrinter.java:3045) com.gi.resto.printer.RestoPOSPrinter.writeCondimentString(RestoPOSPrinter.java:3074) com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2145) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) I've tried everything possible and also, I don't know if this is implemented or not but ParallelPort.isPrinterBusy() always returns false, is this normal? And it seems rxtx setting the parallel mode to EPP or ECP always throws and exception even though my bios supports those modes. Please help, this is frustrating :S -- George H george.dma at gmail.com From thomas.shulok at lmco.com Wed May 19 18:40:38 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Wed, 19 May 2010 18:40:38 -0600 Subject: [Rxtx] lock files, expected behavior? Message-ID: Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 05:05:41 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 20 May 2010 13:05:41 +0200 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, > > > > I know there are a ton of questions about lock files (I think I?ve read all > of them at this point J, but my question is slightly different. In my > application, I initially do a CommPortIdentifier.*getPortIdentifiers*(), > and I get back all my expected com ports. No problem there. Subsequently, > I acquire a port via CommPortIdentifier.*open*(). No problem. But now, > when I do a subsequent CommPortIdentifier.*getPortIdentifiers*(), the port > I acquired is no longer included in the returned enumeration. For the port > in question, the call to getPortIdentifiers produces > > > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File > exists > > > > in the log. Everything I?m doing is in one process space. I?ve confirmed > that my PID and the PID inside the lock file are the same. Does the > implementation check to see if the PID in the lock file is the same as the > PID of the caller, or does it merely check for the existence of the lock > file and bail, regardless of who the caller is? Or am I missing something > else? > > > > Thanks, > > Thom > > (rxtx-2.1.7-r2) > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.shulok at lmco.com Thu May 20 07:43:13 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 20 May 2010 07:43:13 -0600 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Thu May 20 07:44:35 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Thu, 20 May 2010 15:44:35 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Message-ID: Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 07:56:34 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 15:56:34 +0200 Subject: [Rxtx] lock files, expected behavior? References: Message-ID: <81AA8C26A14E43279758AA42434576D9@mdam2> Hi, sorry for previous miss-click :) Shared access to serial ports is very diffucult even if native OS. IMHO this should be done at least in JNI or LOWER/DEEPER in OS, but I don't think that RXTX does it (I am not a developer, only user). So I can only suggest to join Java applications (processes) and sort data inside joined application. Regards Mariusz ----- Original Message ----- From: Shulok, Thomas To: Mariusz Dec Cc: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:43 PM Subject: RE: [Rxtx] lock files, expected behavior? Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point J, but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 08:26:43 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 16:26:43 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver References: Message-ID: <33FE508874504BF4B3A636FCF120D7C0@mdam2> Hi, If you have copied only final jre there is not enough. Installation of the RXTX bins must be compatible with local Java and/or system paths... This is of course theory, because Java is platform independent . In w7-32 there is enough to copy rxtxSerial.dll to Windows/system32 or to Java jre folders something like that: ....Java\jre6\bin\rxtxSerial.dll Regards Mariusz ----- Original Message ----- From: Hans Rupp To: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:44 PM Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu May 20 17:02:09 2010 From: george.dma at gmail.com (George H) Date: Thu, 20 May 2010 23:02:09 +0000 Subject: [Rxtx] Possible bug in ParallelImp.c Message-ID: Hi, I been looking for a reason why .isPrinterBusy() method always returns false for me and I was looking at the ParallelImp.c class and found this #if defined (__linux__) ioctl(fd, LPGETSTATUS, &status); #elif defined (WIN32) I assume this is trying to call the function from ppdev.c in the linux source code, am I right on this? If so then that method does not exist and should be "pp_ioctl" Can someone verify this for me please ? -- George H george.dma at gmail.com From cppgent0 at gmail.com Mon May 24 16:59:09 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Mon, 24 May 2010 15:59:09 -0700 Subject: [Rxtx] lockfile Message-ID: Hi, I have gotten RXTX 1.5-8 (using import gnu.io.*): laptop:~/$ sudo java -noverify -cp extensions/RXTXcomm.jar -jar x.jar RXTX-1.5-8 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 to work with Java 1.6: laptop:~$ java -version java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02) I have a null modem cable between two computers both running Ubuntu 9.10. Typing into minicom on one gets characters coming out on the other running RXTX. So far so good. A couple more things though ... 1) I've searched google and the ubuntu forums + RXTX forums for solutions to the "Illegal use of non-virtual function call", they suggest using " java -noverify" but imply that the problem is fixed in RXTX versions later than 1.4. I'm using 1.5 but have the same issue. laptop:~/$ sudo java -cp extensions/RXTXcomm.jar -jar pakmon.jar RXTX-1.5-8 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 portid: gnu.io.CommPortIdentifier at 50988 Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call Any other options? 2) The lockfile is only working if I run java under root (i.e. using sudo in Ubuntu). a) I checked the lock file permissions. From this message: RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 it looks like '/var/lock' is the lock directory. Here are the permissions: laptop:/var$ ls -al /var/lock drwxrwxrwt 2 root root 40 2010-05-24 15:45 . drwxr-xr-x 16 root root 4096 2010-05-04 11:46 .. i.e. the permissions are wide open for /var/lock b) My user id is part of uucp group: laptop:/var$ id jaxxx uid=1000(jaxxx) gid=1000(jaxxx) groups=1000(jaxxx),4(adm),10(uucp),20(dialout),21(fax),24(cdrom),30(dip),46(plugdev),104(lpadmin),112(netdev),115(admin),120(sambashare) And after adding my userid to the uucp group I rebooted so everything is there. But without using sudo I still get the message: laptop:~/$ java -noverify -cp extensions/RXTXcomm.jar -jar pakmon.jar RXTX-1.5-8 0 -1216889792 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL What else should I try to get this to work under my local userid? Thanks for your help, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From cppgent0 at gmail.com Mon May 24 17:30:28 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Mon, 24 May 2010 16:30:28 -0700 Subject: [Rxtx] lockfile In-Reply-To: References: Message-ID: I upgraded to RXTX-2.1-7 and it all works just fine: laptop:~/$ java -jar xx.jar Experimental: JNI_OnLoad called. RXTX-2.1-7 Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 portid: gnu.io.CommPortIdentifier at 1bcdbf6 (Yeah you knew this email was coming! :) Thanks anyway, John On Mon, May 24, 2010 at 3:59 PM, J Arrizza wrote: > Hi, > > I have gotten RXTX 1.5-8 (using import gnu.io.*): > > laptop:~/$ sudo java -noverify -cp extensions/RXTXcomm.jar -jar x.jar > > RXTX-1.5-8 > RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 > Found port: /dev/ttyS0 > > > to work with Java 1.6: > > > laptop:~$ java -version > java version "1.6.0_20" > Java(TM) SE Runtime Environment (build 1.6.0_20-b02) > > > > I have a null modem cable between two computers both running Ubuntu 9.10. > Typing into minicom on one gets characters coming out on the other running > RXTX. So far so good. > > A couple more things though ... > > 1) I've searched google and the ubuntu forums + RXTX forums for solutions > to the "Illegal use of non-virtual function call", they suggest using " java > -noverify" but imply that the problem is fixed in RXTX versions later than > 1.4. I'm using 1.5 but have the same issue. > > laptop:~/$ sudo java -cp extensions/RXTXcomm.jar -jar pakmon.jar > RXTX-1.5-8 > RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 > Found port: /dev/ttyS0 > portid: gnu.io.CommPortIdentifier at 50988 > Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal > use of nonvirtual function call > > > Any other options? > > 2) The lockfile is only working if I run java under root (i.e. using sudo > in Ubuntu). > > a) I checked the lock file permissions. From this message: > > RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 > > > it looks like '/var/lock' is the lock directory. Here are the permissions: > > laptop:/var$ ls -al /var/lock > drwxrwxrwt 2 root root 40 2010-05-24 15:45 . > drwxr-xr-x 16 root root 4096 2010-05-04 11:46 .. > > > i.e. the permissions are wide open for /var/lock > > b) My user id is part of uucp group: > > laptop:/var$ id jaxxx > uid=1000(jaxxx) gid=1000(jaxxx) > groups=1000(jaxxx),4(adm),10(uucp),20(dialout),21(fax),24(cdrom),30(dip),46(plugdev),104(lpadmin),112(netdev),115(admin),120(sambashare) > > > And after adding my userid to the uucp group I rebooted so everything is > there. > > But without using sudo I still get the message: > > laptop:~/$ java -noverify -cp extensions/RXTXcomm.jar -jar pakmon.jar > RXTX-1.5-8 > 0 -1216889792 > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > > What else should I try to get this to work under my local userid? > > > Thanks for your help, > John > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ra85551 at gmail.com Fri May 14 08:51:34 2010 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Fri, 14 May 2010 18:51:34 +0400 Subject: [Rxtx] problem with compiling RXTX for OpenWrt 10.03 host Message-ID: Hello, I try to compile RXTX for use on OpenWrt box. ./configure --host=mipsel-openwrt-linux --prefix=/home/pavel/rxtx2.2-bin make But I've been got a following error: mipsel-openwrt-linux-gcc -I/home/pavel/rxtx-2.2pre2 -Imipsel-openwrt-linux-gnu -I. -I/opt/java/include -I/opt/java/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/pavel/rxtx-2.2pre2/./src/RawImp.c -fPIC -DPIC -o /home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/.libs/RawImp.o /home/pavel/rxtx-2.2pre2/./src/RawImp.c:104:20: sys/io.h: No such file or directory libtool: link: `/home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/RawImp.lo' is not a valid libtool object I've found no better solution than comment out entire line 104 in src/RawImp.c 104c104 < //#include --- > #include After that compilation has been succeeded. But is this the best way to compile? -- Pavel Parkhomenko From davestechshop at gmail.com Fri May 14 13:08:58 2010 From: davestechshop at gmail.com (Dave) Date: Fri, 14 May 2010 15:08:58 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux Message-ID: Here is some non-technical feedback about rxtx on two platforms. (I'm not a developer.) We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, but it has one problem we can't overcome. Windows: -------------------- 2.2pre2 on Windows crashes when the connected device is turned off or unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. Linux: -------------------- The best way I can explain the 2.2.pre2 problem on Linux is to paste this: "Tell them the read on the inputstream doesn't block, and when you enable the receiveTimeout, it gets forgotten after the first bytes are received [and it cannot be re-asserted]." Workarounds: -------------------- A workaround for the problem is possible on Windows, but we haven't found one for Linux. Our code is doing something that is not done by the example code generous people on this list helped me with. Our code receives many serial input events over 24 hours without intentionally disconnecting. The receiveTimeout problem is only evident after the first data packet is complete and the connection remains open for some time. Furthermore, if the instrument is disconnected, our app needs to wait and reconnect when the instrument becomes available. rxtx 2.2pre2 will not do this (on Windows). However, 2.1.7 will handle the disconnect and recover. The biggest problem for us is 2.2pre2 on Linux because we haven't found any workaround yet. We can't go back to 2.1.7 on Linux either (because it apparently doesn't work). Wish I could say something that would be more meaningful to you guys (especially the devs), but I hope what I have said is of value to someone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 15 00:52:11 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 15 May 2010 08:52:11 +0200 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: 2010/5/14 Dave > Here is some non-technical feedback about rxtx on two platforms. (I'm not a > developer.) > > We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, > but it has one problem we can't overcome. > > Windows: > -------------------- > 2.2pre2 on Windows crashes when the connected device is turned off or > unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. > Hi Dave Sorry - I don't agree with above description - I have had more problems with 2.1.7... I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting USB dongle if I am using software construction shown in my previous examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. Everything is to safelly catch in Java and reconnect! There are several things more while working with system's suspend's as well. I have observed (mainly in W7) that small activity of the COM channel may results in VCP driver deactivation (or somethnig like that). Therefore I have prepared my external device to generate dummy data (SW software version) in declared time intervals. Problems has gone... In Vista there were enough to disable energy saving on USB ports in notebook - this problem wasn't observed on desktop. Regards Mariusz > Linux: > -------------------- > The best way I can explain the 2.2.pre2 problem on Linux is to paste this: > > "Tell them the read on the inputstream doesn't block, and when you enable > the receiveTimeout, it gets forgotten after the first bytes are received > [and it cannot be re-asserted]." > > Workarounds: > -------------------- > A workaround for the problem is possible on Windows, but we haven't found > one for Linux. > > Our code is doing something that is not done by the example code generous > people on this list helped me with. Our code receives many serial input > events over 24 hours without intentionally disconnecting. The receiveTimeout > problem is only evident after the first data packet is complete and the > connection remains open for some time. > > Furthermore, if the instrument is disconnected, our app needs to wait and > reconnect when the instrument becomes available. rxtx 2.2pre2 will not do > this (on Windows). However, 2.1.7 will handle the disconnect and recover. > > The biggest problem for us is 2.2pre2 on Linux because we haven't found any > workaround yet. We can't go back to 2.1.7 on Linux either (because it > apparently doesn't work). > > Wish I could say something that would be more meaningful to you guys > (especially the devs), but I hope what I have said is of value to someone. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Sat May 15 02:30:49 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 08:30:49 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 Message-ID: Hi, I just wanted to know why the parallel port dll for windows is missing in the pre2.2 binary package? Does anyone have it compiled and working? Thanks -- George H george.dma at gmail.com From george.dma at gmail.com Sat May 15 03:33:08 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 09:33:08 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 In-Reply-To: References: Message-ID: On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked?? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > From mariusz.dec at gmail.com Sat May 15 05:38:29 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 15 May 2010 13:38:29 +0200 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 References: Message-ID: <57E4C18871C249EC82846512B38F121D@mdam2> Hi, I have just compiled it, but my RXTX 2.2 pre hasn't last CVS's. Do you have any FTP? Many mail relay servers blocks mails with dll's. Regards Mariusz ----- Original Message ----- From: "George H" To: "rxtx" Sent: Saturday, May 15, 2010 11:33 AM Subject: Re: [Rxtx] ParallelPort dll missing for windows in pre2.2 On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From davestechshop at gmail.com Sat May 15 15:04:02 2010 From: davestechshop at gmail.com (Dave) Date: Sat, 15 May 2010 17:04:02 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: Your example code was very, very helpful. However, the developer told me that your example code does not test the scenarios we are encountering. I'll see if I can get him to post a little more info. Sorry I don't have more to add at this time. Dave On Sat, May 15, 2010 at 2:52 AM, Mariusz Dec wrote: > > > 2010/5/14 Dave > > Here is some non-technical feedback about rxtx on two platforms. (I'm not a >> developer.) >> >> We can't get 2.2pre2 to work reliably on Windows. It works better on >> Linux, but it has one problem we can't overcome. >> >> Windows: >> -------------------- >> 2.2pre2 on Windows crashes when the connected device is turned off or >> unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. >> > > Hi Dave > > Sorry - I don't agree with above description - I have had more problems > with 2.1.7... > > I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting > USB dongle if I am using software construction shown in my previous > examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. > Everything is to safelly catch in Java and reconnect! > > There are several things more while working with system's suspend's as > well. > > I have observed (mainly in W7) that small activity of the COM channel may > results in VCP driver deactivation (or somethnig like that). > Therefore I have prepared my external device to generate dummy data (SW > software version) in declared time intervals. > Problems has gone... > In Vista there were enough to disable energy saving on USB ports in > notebook - this problem wasn't observed on desktop. > > > Regards > Mariusz > > >> Linux: >> -------------------- >> The best way I can explain the 2.2.pre2 problem on Linux is to paste this: >> >> "Tell them the read on the inputstream doesn't block, and when you enable >> the receiveTimeout, it gets forgotten after the first bytes are received >> [and it cannot be re-asserted]." >> >> Workarounds: >> -------------------- >> A workaround for the problem is possible on Windows, but we haven't found >> one for Linux. >> >> Our code is doing something that is not done by the example code generous >> people on this list helped me with. Our code receives many serial input >> events over 24 hours without intentionally disconnecting. The receiveTimeout >> problem is only evident after the first data packet is complete and the >> connection remains open for some time. >> >> Furthermore, if the instrument is disconnected, our app needs to wait and >> reconnect when the instrument becomes available. rxtx 2.2pre2 will not do >> this (on Windows). However, 2.1.7 will handle the disconnect and recover. >> >> The biggest problem for us is 2.2pre2 on Linux because we haven't found >> any workaround yet. We can't go back to 2.1.7 on Linux either (because it >> apparently doesn't work). >> >> Wish I could say something that would be more meaningful to you guys >> (especially the devs), but I hope what I have said is of value to someone. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon May 17 08:36:43 2010 From: george.dma at gmail.com (George H) Date: Mon, 17 May 2010 14:36:43 +0000 Subject: [Rxtx] Printing hangs when sending data to parallel port Message-ID: Hi, I am getting a really weird and annoying problem and I have exhausted all options. I am using rxtx pre2.2 on linux. I am connecting to a receipt printer on a parallel port (/dev/lp0) The receipt printer has a 4.0Kb data buffer Here's the problem. In my java program when I send it bytes (and I do a .flush() after each invocation of .write(byte[])) it prints the data but stops arbitrarily during the print process. I wait a bit... re-send the data to get printed. 1 out of 3 times it succeeds and prints everything. But with long data it has problems. Now here is the weird part. I create a text file with 7Kb of text data. I run the command "cat test.txt > /dev/lp0" and the printer prints everything in 1 go without any problems. So I don't know, I am thinking maybe this is a problem with rxtx ? maybe I need to set some parallel parameters? Or should I try reverting to the 2.1 version of rxtx if the parallel code is more reliable? Thanks for helping -- George H george.dma at gmail.com From george.dma at gmail.com Tue May 18 00:16:54 2010 From: george.dma at gmail.com (George H) Date: Tue, 18 May 2010 09:16:54 +0300 Subject: [Rxtx] Printing hangs when sending data to parallel port In-Reply-To: References: Message-ID: On Mon, May 17, 2010 at 5:36 PM, George H wrote: > Hi, > > I am getting a really weird and annoying problem and I have exhausted > all options. I am using rxtx pre2.2 on linux. > I am connecting to a receipt printer on a parallel port (/dev/lp0) The > receipt printer has a 4.0Kb data buffer > > Here's the problem. In my java program when I send it bytes (and I do > a .flush() after each invocation of .write(byte[])) it prints the data > but stops arbitrarily during the print process. I wait a bit... > re-send the data to get printed. 1 out of 3 times it succeeds and > prints everything. But with long data it has problems. > > Now here is the weird part. I create a text file with 7Kb of text > data. I run the command ? "cat test.txt > /dev/lp0" and the printer > prints everything in 1 go without any problems. > > So I don't know, I am thinking maybe this is a problem with rxtx ? > maybe I need to set some parallel parameters? Or should I try > reverting to the 2.1 version of rxtx if the parallel code is more > reliable? > > Thanks for helping After testing we found out that we need to send the text to the printer as UTF8 bytes and best to include a 50ms blocking parameter when connecting to the parallel port. So I'm glad to say that rxtx was not the problem, just me not knowing the above were a requirement. > > -- > George H > george.dma at gmail.com > From george.dma at gmail.com Wed May 19 11:17:55 2010 From: george.dma at gmail.com (George H) Date: Wed, 19 May 2010 17:17:55 +0000 Subject: [Rxtx] Resource temporarily unavailable on writeByte() Message-ID: Hi, This affects rxtx 2.1.7 and 2.2pre2 I have a POS receipt printer connected via parallel port. The BIOS is set to use SPP more for the parallel port. I am sending bytes to the parallel outputstream using the out.write(int b) method and just for safety I call flush after each write.. out.write(b); out.flush(); When I queue up arrays of bytes to be written that way, it will keep printing and then throw a "java.io.IOException: Resource temporarily unavailable in writeByte" all the time. I did a dirty workaround by pausing 2 seconds between printing receipts and it seems to postpone the error from happening, but it still happens. I thought it was maybe a threading problem from my app... so I made a program to just skip all the threading stuff and just print directly. Same problem. The below exception was thrown when using the 2.1.7 version of rxtx java.io.IOException: Resource temporarily unavailable in writeArray com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2381) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) Caused by: Resource temporarily unavailable in writeArray gnu.io.LPRPort.writeArray(Native Method) gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:281) com.gi.pos.comm.parallel.ParallelCommWriter.write(ParallelCommWriter.java:62) com.gi.pos.comm.parallel.ParallelCommWriter.writeString(ParallelCommWriter.java:52) com.gi.pos.comm.POSCommPort.writeString(POSCommPort.java:95) com.gi.resto.printer.RestoPOSPrinter.writeTwoStrings(RestoPOSPrinter.java:3045) com.gi.resto.printer.RestoPOSPrinter.writeCondimentString(RestoPOSPrinter.java:3074) com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2145) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) I've tried everything possible and also, I don't know if this is implemented or not but ParallelPort.isPrinterBusy() always returns false, is this normal? And it seems rxtx setting the parallel mode to EPP or ECP always throws and exception even though my bios supports those modes. Please help, this is frustrating :S -- George H george.dma at gmail.com From thomas.shulok at lmco.com Wed May 19 18:40:38 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Wed, 19 May 2010 18:40:38 -0600 Subject: [Rxtx] lock files, expected behavior? Message-ID: Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 05:05:41 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 20 May 2010 13:05:41 +0200 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, > > > > I know there are a ton of questions about lock files (I think I?ve read all > of them at this point J, but my question is slightly different. In my > application, I initially do a CommPortIdentifier.*getPortIdentifiers*(), > and I get back all my expected com ports. No problem there. Subsequently, > I acquire a port via CommPortIdentifier.*open*(). No problem. But now, > when I do a subsequent CommPortIdentifier.*getPortIdentifiers*(), the port > I acquired is no longer included in the returned enumeration. For the port > in question, the call to getPortIdentifiers produces > > > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File > exists > > > > in the log. Everything I?m doing is in one process space. I?ve confirmed > that my PID and the PID inside the lock file are the same. Does the > implementation check to see if the PID in the lock file is the same as the > PID of the caller, or does it merely check for the existence of the lock > file and bail, regardless of who the caller is? Or am I missing something > else? > > > > Thanks, > > Thom > > (rxtx-2.1.7-r2) > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.shulok at lmco.com Thu May 20 07:43:13 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 20 May 2010 07:43:13 -0600 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Thu May 20 07:44:35 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Thu, 20 May 2010 15:44:35 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Message-ID: Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 07:56:34 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 15:56:34 +0200 Subject: [Rxtx] lock files, expected behavior? References: Message-ID: <81AA8C26A14E43279758AA42434576D9@mdam2> Hi, sorry for previous miss-click :) Shared access to serial ports is very diffucult even if native OS. IMHO this should be done at least in JNI or LOWER/DEEPER in OS, but I don't think that RXTX does it (I am not a developer, only user). So I can only suggest to join Java applications (processes) and sort data inside joined application. Regards Mariusz ----- Original Message ----- From: Shulok, Thomas To: Mariusz Dec Cc: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:43 PM Subject: RE: [Rxtx] lock files, expected behavior? Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point J, but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 08:26:43 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 16:26:43 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver References: Message-ID: <33FE508874504BF4B3A636FCF120D7C0@mdam2> Hi, If you have copied only final jre there is not enough. Installation of the RXTX bins must be compatible with local Java and/or system paths... This is of course theory, because Java is platform independent . In w7-32 there is enough to copy rxtxSerial.dll to Windows/system32 or to Java jre folders something like that: ....Java\jre6\bin\rxtxSerial.dll Regards Mariusz ----- Original Message ----- From: Hans Rupp To: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:44 PM Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu May 20 17:02:09 2010 From: george.dma at gmail.com (George H) Date: Thu, 20 May 2010 23:02:09 +0000 Subject: [Rxtx] Possible bug in ParallelImp.c Message-ID: Hi, I been looking for a reason why .isPrinterBusy() method always returns false for me and I was looking at the ParallelImp.c class and found this #if defined (__linux__) ioctl(fd, LPGETSTATUS, &status); #elif defined (WIN32) I assume this is trying to call the function from ppdev.c in the linux source code, am I right on this? If so then that method does not exist and should be "pp_ioctl" Can someone verify this for me please ? -- George H george.dma at gmail.com From cppgent0 at gmail.com Mon May 24 16:59:09 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Mon, 24 May 2010 15:59:09 -0700 Subject: [Rxtx] lockfile Message-ID: Hi, I have gotten RXTX 1.5-8 (using import gnu.io.*): laptop:~/$ sudo java -noverify -cp extensions/RXTXcomm.jar -jar x.jar RXTX-1.5-8 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 to work with Java 1.6: laptop:~$ java -version java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02) I have a null modem cable between two computers both running Ubuntu 9.10. Typing into minicom on one gets characters coming out on the other running RXTX. So far so good. A couple more things though ... 1) I've searched google and the ubuntu forums + RXTX forums for solutions to the "Illegal use of non-virtual function call", they suggest using " java -noverify" but imply that the problem is fixed in RXTX versions later than 1.4. I'm using 1.5 but have the same issue. laptop:~/$ sudo java -cp extensions/RXTXcomm.jar -jar pakmon.jar RXTX-1.5-8 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 portid: gnu.io.CommPortIdentifier at 50988 Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call Any other options? 2) The lockfile is only working if I run java under root (i.e. using sudo in Ubuntu). a) I checked the lock file permissions. From this message: RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 it looks like '/var/lock' is the lock directory. Here are the permissions: laptop:/var$ ls -al /var/lock drwxrwxrwt 2 root root 40 2010-05-24 15:45 . drwxr-xr-x 16 root root 4096 2010-05-04 11:46 .. i.e. the permissions are wide open for /var/lock b) My user id is part of uucp group: laptop:/var$ id jaxxx uid=1000(jaxxx) gid=1000(jaxxx) groups=1000(jaxxx),4(adm),10(uucp),20(dialout),21(fax),24(cdrom),30(dip),46(plugdev),104(lpadmin),112(netdev),115(admin),120(sambashare) And after adding my userid to the uucp group I rebooted so everything is there. But without using sudo I still get the message: laptop:~/$ java -noverify -cp extensions/RXTXcomm.jar -jar pakmon.jar RXTX-1.5-8 0 -1216889792 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL What else should I try to get this to work under my local userid? Thanks for your help, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From cppgent0 at gmail.com Mon May 24 17:30:28 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Mon, 24 May 2010 16:30:28 -0700 Subject: [Rxtx] lockfile In-Reply-To: References: Message-ID: I upgraded to RXTX-2.1-7 and it all works just fine: laptop:~/$ java -jar xx.jar Experimental: JNI_OnLoad called. RXTX-2.1-7 Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 portid: gnu.io.CommPortIdentifier at 1bcdbf6 (Yeah you knew this email was coming! :) Thanks anyway, John On Mon, May 24, 2010 at 3:59 PM, J Arrizza wrote: > Hi, > > I have gotten RXTX 1.5-8 (using import gnu.io.*): > > laptop:~/$ sudo java -noverify -cp extensions/RXTXcomm.jar -jar x.jar > > RXTX-1.5-8 > RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 > Found port: /dev/ttyS0 > > > to work with Java 1.6: > > > laptop:~$ java -version > java version "1.6.0_20" > Java(TM) SE Runtime Environment (build 1.6.0_20-b02) > > > > I have a null modem cable between two computers both running Ubuntu 9.10. > Typing into minicom on one gets characters coming out on the other running > RXTX. So far so good. > > A couple more things though ... > > 1) I've searched google and the ubuntu forums + RXTX forums for solutions > to the "Illegal use of non-virtual function call", they suggest using " java > -noverify" but imply that the problem is fixed in RXTX versions later than > 1.4. I'm using 1.5 but have the same issue. > > laptop:~/$ sudo java -cp extensions/RXTXcomm.jar -jar pakmon.jar > RXTX-1.5-8 > RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 > Found port: /dev/ttyS0 > portid: gnu.io.CommPortIdentifier at 50988 > Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal > use of nonvirtual function call > > > Any other options? > > 2) The lockfile is only working if I run java under root (i.e. using sudo > in Ubuntu). > > a) I checked the lock file permissions. From this message: > > RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 > > > it looks like '/var/lock' is the lock directory. Here are the permissions: > > laptop:/var$ ls -al /var/lock > drwxrwxrwt 2 root root 40 2010-05-24 15:45 . > drwxr-xr-x 16 root root 4096 2010-05-04 11:46 .. > > > i.e. the permissions are wide open for /var/lock > > b) My user id is part of uucp group: > > laptop:/var$ id jaxxx > uid=1000(jaxxx) gid=1000(jaxxx) > groups=1000(jaxxx),4(adm),10(uucp),20(dialout),21(fax),24(cdrom),30(dip),46(plugdev),104(lpadmin),112(netdev),115(admin),120(sambashare) > > > And after adding my userid to the uucp group I rebooted so everything is > there. > > But without using sudo I still get the message: > > laptop:~/$ java -noverify -cp extensions/RXTXcomm.jar -jar pakmon.jar > RXTX-1.5-8 > 0 -1216889792 > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > > What else should I try to get this to work under my local userid? > > > Thanks for your help, > John > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ra85551 at gmail.com Fri May 14 08:51:34 2010 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Fri, 14 May 2010 18:51:34 +0400 Subject: [Rxtx] problem with compiling RXTX for OpenWrt 10.03 host Message-ID: Hello, I try to compile RXTX for use on OpenWrt box. ./configure --host=mipsel-openwrt-linux --prefix=/home/pavel/rxtx2.2-bin make But I've been got a following error: mipsel-openwrt-linux-gcc -I/home/pavel/rxtx-2.2pre2 -Imipsel-openwrt-linux-gnu -I. -I/opt/java/include -I/opt/java/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/pavel/rxtx-2.2pre2/./src/RawImp.c -fPIC -DPIC -o /home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/.libs/RawImp.o /home/pavel/rxtx-2.2pre2/./src/RawImp.c:104:20: sys/io.h: No such file or directory libtool: link: `/home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/RawImp.lo' is not a valid libtool object I've found no better solution than comment out entire line 104 in src/RawImp.c 104c104 < //#include --- > #include After that compilation has been succeeded. But is this the best way to compile? -- Pavel Parkhomenko From davestechshop at gmail.com Fri May 14 13:08:58 2010 From: davestechshop at gmail.com (Dave) Date: Fri, 14 May 2010 15:08:58 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux Message-ID: Here is some non-technical feedback about rxtx on two platforms. (I'm not a developer.) We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, but it has one problem we can't overcome. Windows: -------------------- 2.2pre2 on Windows crashes when the connected device is turned off or unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. Linux: -------------------- The best way I can explain the 2.2.pre2 problem on Linux is to paste this: "Tell them the read on the inputstream doesn't block, and when you enable the receiveTimeout, it gets forgotten after the first bytes are received [and it cannot be re-asserted]." Workarounds: -------------------- A workaround for the problem is possible on Windows, but we haven't found one for Linux. Our code is doing something that is not done by the example code generous people on this list helped me with. Our code receives many serial input events over 24 hours without intentionally disconnecting. The receiveTimeout problem is only evident after the first data packet is complete and the connection remains open for some time. Furthermore, if the instrument is disconnected, our app needs to wait and reconnect when the instrument becomes available. rxtx 2.2pre2 will not do this (on Windows). However, 2.1.7 will handle the disconnect and recover. The biggest problem for us is 2.2pre2 on Linux because we haven't found any workaround yet. We can't go back to 2.1.7 on Linux either (because it apparently doesn't work). Wish I could say something that would be more meaningful to you guys (especially the devs), but I hope what I have said is of value to someone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 15 00:52:11 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 15 May 2010 08:52:11 +0200 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: 2010/5/14 Dave > Here is some non-technical feedback about rxtx on two platforms. (I'm not a > developer.) > > We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, > but it has one problem we can't overcome. > > Windows: > -------------------- > 2.2pre2 on Windows crashes when the connected device is turned off or > unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. > Hi Dave Sorry - I don't agree with above description - I have had more problems with 2.1.7... I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting USB dongle if I am using software construction shown in my previous examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. Everything is to safelly catch in Java and reconnect! There are several things more while working with system's suspend's as well. I have observed (mainly in W7) that small activity of the COM channel may results in VCP driver deactivation (or somethnig like that). Therefore I have prepared my external device to generate dummy data (SW software version) in declared time intervals. Problems has gone... In Vista there were enough to disable energy saving on USB ports in notebook - this problem wasn't observed on desktop. Regards Mariusz > Linux: > -------------------- > The best way I can explain the 2.2.pre2 problem on Linux is to paste this: > > "Tell them the read on the inputstream doesn't block, and when you enable > the receiveTimeout, it gets forgotten after the first bytes are received > [and it cannot be re-asserted]." > > Workarounds: > -------------------- > A workaround for the problem is possible on Windows, but we haven't found > one for Linux. > > Our code is doing something that is not done by the example code generous > people on this list helped me with. Our code receives many serial input > events over 24 hours without intentionally disconnecting. The receiveTimeout > problem is only evident after the first data packet is complete and the > connection remains open for some time. > > Furthermore, if the instrument is disconnected, our app needs to wait and > reconnect when the instrument becomes available. rxtx 2.2pre2 will not do > this (on Windows). However, 2.1.7 will handle the disconnect and recover. > > The biggest problem for us is 2.2pre2 on Linux because we haven't found any > workaround yet. We can't go back to 2.1.7 on Linux either (because it > apparently doesn't work). > > Wish I could say something that would be more meaningful to you guys > (especially the devs), but I hope what I have said is of value to someone. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Sat May 15 02:30:49 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 08:30:49 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 Message-ID: Hi, I just wanted to know why the parallel port dll for windows is missing in the pre2.2 binary package? Does anyone have it compiled and working? Thanks -- George H george.dma at gmail.com From george.dma at gmail.com Sat May 15 03:33:08 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 09:33:08 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 In-Reply-To: References: Message-ID: On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked?? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > From mariusz.dec at gmail.com Sat May 15 05:38:29 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 15 May 2010 13:38:29 +0200 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 References: Message-ID: <57E4C18871C249EC82846512B38F121D@mdam2> Hi, I have just compiled it, but my RXTX 2.2 pre hasn't last CVS's. Do you have any FTP? Many mail relay servers blocks mails with dll's. Regards Mariusz ----- Original Message ----- From: "George H" To: "rxtx" Sent: Saturday, May 15, 2010 11:33 AM Subject: Re: [Rxtx] ParallelPort dll missing for windows in pre2.2 On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From davestechshop at gmail.com Sat May 15 15:04:02 2010 From: davestechshop at gmail.com (Dave) Date: Sat, 15 May 2010 17:04:02 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: Your example code was very, very helpful. However, the developer told me that your example code does not test the scenarios we are encountering. I'll see if I can get him to post a little more info. Sorry I don't have more to add at this time. Dave On Sat, May 15, 2010 at 2:52 AM, Mariusz Dec wrote: > > > 2010/5/14 Dave > > Here is some non-technical feedback about rxtx on two platforms. (I'm not a >> developer.) >> >> We can't get 2.2pre2 to work reliably on Windows. It works better on >> Linux, but it has one problem we can't overcome. >> >> Windows: >> -------------------- >> 2.2pre2 on Windows crashes when the connected device is turned off or >> unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. >> > > Hi Dave > > Sorry - I don't agree with above description - I have had more problems > with 2.1.7... > > I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting > USB dongle if I am using software construction shown in my previous > examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. > Everything is to safelly catch in Java and reconnect! > > There are several things more while working with system's suspend's as > well. > > I have observed (mainly in W7) that small activity of the COM channel may > results in VCP driver deactivation (or somethnig like that). > Therefore I have prepared my external device to generate dummy data (SW > software version) in declared time intervals. > Problems has gone... > In Vista there were enough to disable energy saving on USB ports in > notebook - this problem wasn't observed on desktop. > > > Regards > Mariusz > > >> Linux: >> -------------------- >> The best way I can explain the 2.2.pre2 problem on Linux is to paste this: >> >> "Tell them the read on the inputstream doesn't block, and when you enable >> the receiveTimeout, it gets forgotten after the first bytes are received >> [and it cannot be re-asserted]." >> >> Workarounds: >> -------------------- >> A workaround for the problem is possible on Windows, but we haven't found >> one for Linux. >> >> Our code is doing something that is not done by the example code generous >> people on this list helped me with. Our code receives many serial input >> events over 24 hours without intentionally disconnecting. The receiveTimeout >> problem is only evident after the first data packet is complete and the >> connection remains open for some time. >> >> Furthermore, if the instrument is disconnected, our app needs to wait and >> reconnect when the instrument becomes available. rxtx 2.2pre2 will not do >> this (on Windows). However, 2.1.7 will handle the disconnect and recover. >> >> The biggest problem for us is 2.2pre2 on Linux because we haven't found >> any workaround yet. We can't go back to 2.1.7 on Linux either (because it >> apparently doesn't work). >> >> Wish I could say something that would be more meaningful to you guys >> (especially the devs), but I hope what I have said is of value to someone. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon May 17 08:36:43 2010 From: george.dma at gmail.com (George H) Date: Mon, 17 May 2010 14:36:43 +0000 Subject: [Rxtx] Printing hangs when sending data to parallel port Message-ID: Hi, I am getting a really weird and annoying problem and I have exhausted all options. I am using rxtx pre2.2 on linux. I am connecting to a receipt printer on a parallel port (/dev/lp0) The receipt printer has a 4.0Kb data buffer Here's the problem. In my java program when I send it bytes (and I do a .flush() after each invocation of .write(byte[])) it prints the data but stops arbitrarily during the print process. I wait a bit... re-send the data to get printed. 1 out of 3 times it succeeds and prints everything. But with long data it has problems. Now here is the weird part. I create a text file with 7Kb of text data. I run the command "cat test.txt > /dev/lp0" and the printer prints everything in 1 go without any problems. So I don't know, I am thinking maybe this is a problem with rxtx ? maybe I need to set some parallel parameters? Or should I try reverting to the 2.1 version of rxtx if the parallel code is more reliable? Thanks for helping -- George H george.dma at gmail.com From george.dma at gmail.com Tue May 18 00:16:54 2010 From: george.dma at gmail.com (George H) Date: Tue, 18 May 2010 09:16:54 +0300 Subject: [Rxtx] Printing hangs when sending data to parallel port In-Reply-To: References: Message-ID: On Mon, May 17, 2010 at 5:36 PM, George H wrote: > Hi, > > I am getting a really weird and annoying problem and I have exhausted > all options. I am using rxtx pre2.2 on linux. > I am connecting to a receipt printer on a parallel port (/dev/lp0) The > receipt printer has a 4.0Kb data buffer > > Here's the problem. In my java program when I send it bytes (and I do > a .flush() after each invocation of .write(byte[])) it prints the data > but stops arbitrarily during the print process. I wait a bit... > re-send the data to get printed. 1 out of 3 times it succeeds and > prints everything. But with long data it has problems. > > Now here is the weird part. I create a text file with 7Kb of text > data. I run the command ? "cat test.txt > /dev/lp0" and the printer > prints everything in 1 go without any problems. > > So I don't know, I am thinking maybe this is a problem with rxtx ? > maybe I need to set some parallel parameters? Or should I try > reverting to the 2.1 version of rxtx if the parallel code is more > reliable? > > Thanks for helping After testing we found out that we need to send the text to the printer as UTF8 bytes and best to include a 50ms blocking parameter when connecting to the parallel port. So I'm glad to say that rxtx was not the problem, just me not knowing the above were a requirement. > > -- > George H > george.dma at gmail.com > From george.dma at gmail.com Wed May 19 11:17:55 2010 From: george.dma at gmail.com (George H) Date: Wed, 19 May 2010 17:17:55 +0000 Subject: [Rxtx] Resource temporarily unavailable on writeByte() Message-ID: Hi, This affects rxtx 2.1.7 and 2.2pre2 I have a POS receipt printer connected via parallel port. The BIOS is set to use SPP more for the parallel port. I am sending bytes to the parallel outputstream using the out.write(int b) method and just for safety I call flush after each write.. out.write(b); out.flush(); When I queue up arrays of bytes to be written that way, it will keep printing and then throw a "java.io.IOException: Resource temporarily unavailable in writeByte" all the time. I did a dirty workaround by pausing 2 seconds between printing receipts and it seems to postpone the error from happening, but it still happens. I thought it was maybe a threading problem from my app... so I made a program to just skip all the threading stuff and just print directly. Same problem. The below exception was thrown when using the 2.1.7 version of rxtx java.io.IOException: Resource temporarily unavailable in writeArray com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2381) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) Caused by: Resource temporarily unavailable in writeArray gnu.io.LPRPort.writeArray(Native Method) gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:281) com.gi.pos.comm.parallel.ParallelCommWriter.write(ParallelCommWriter.java:62) com.gi.pos.comm.parallel.ParallelCommWriter.writeString(ParallelCommWriter.java:52) com.gi.pos.comm.POSCommPort.writeString(POSCommPort.java:95) com.gi.resto.printer.RestoPOSPrinter.writeTwoStrings(RestoPOSPrinter.java:3045) com.gi.resto.printer.RestoPOSPrinter.writeCondimentString(RestoPOSPrinter.java:3074) com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2145) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) I've tried everything possible and also, I don't know if this is implemented or not but ParallelPort.isPrinterBusy() always returns false, is this normal? And it seems rxtx setting the parallel mode to EPP or ECP always throws and exception even though my bios supports those modes. Please help, this is frustrating :S -- George H george.dma at gmail.com From thomas.shulok at lmco.com Wed May 19 18:40:38 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Wed, 19 May 2010 18:40:38 -0600 Subject: [Rxtx] lock files, expected behavior? Message-ID: Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 05:05:41 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 20 May 2010 13:05:41 +0200 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, > > > > I know there are a ton of questions about lock files (I think I?ve read all > of them at this point J, but my question is slightly different. In my > application, I initially do a CommPortIdentifier.*getPortIdentifiers*(), > and I get back all my expected com ports. No problem there. Subsequently, > I acquire a port via CommPortIdentifier.*open*(). No problem. But now, > when I do a subsequent CommPortIdentifier.*getPortIdentifiers*(), the port > I acquired is no longer included in the returned enumeration. For the port > in question, the call to getPortIdentifiers produces > > > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File > exists > > > > in the log. Everything I?m doing is in one process space. I?ve confirmed > that my PID and the PID inside the lock file are the same. Does the > implementation check to see if the PID in the lock file is the same as the > PID of the caller, or does it merely check for the existence of the lock > file and bail, regardless of who the caller is? Or am I missing something > else? > > > > Thanks, > > Thom > > (rxtx-2.1.7-r2) > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.shulok at lmco.com Thu May 20 07:43:13 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 20 May 2010 07:43:13 -0600 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Thu May 20 07:44:35 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Thu, 20 May 2010 15:44:35 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Message-ID: Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 07:56:34 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 15:56:34 +0200 Subject: [Rxtx] lock files, expected behavior? References: Message-ID: <81AA8C26A14E43279758AA42434576D9@mdam2> Hi, sorry for previous miss-click :) Shared access to serial ports is very diffucult even if native OS. IMHO this should be done at least in JNI or LOWER/DEEPER in OS, but I don't think that RXTX does it (I am not a developer, only user). So I can only suggest to join Java applications (processes) and sort data inside joined application. Regards Mariusz ----- Original Message ----- From: Shulok, Thomas To: Mariusz Dec Cc: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:43 PM Subject: RE: [Rxtx] lock files, expected behavior? Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point J, but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 08:26:43 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 16:26:43 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver References: Message-ID: <33FE508874504BF4B3A636FCF120D7C0@mdam2> Hi, If you have copied only final jre there is not enough. Installation of the RXTX bins must be compatible with local Java and/or system paths... This is of course theory, because Java is platform independent . In w7-32 there is enough to copy rxtxSerial.dll to Windows/system32 or to Java jre folders something like that: ....Java\jre6\bin\rxtxSerial.dll Regards Mariusz ----- Original Message ----- From: Hans Rupp To: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:44 PM Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu May 20 17:02:09 2010 From: george.dma at gmail.com (George H) Date: Thu, 20 May 2010 23:02:09 +0000 Subject: [Rxtx] Possible bug in ParallelImp.c Message-ID: Hi, I been looking for a reason why .isPrinterBusy() method always returns false for me and I was looking at the ParallelImp.c class and found this #if defined (__linux__) ioctl(fd, LPGETSTATUS, &status); #elif defined (WIN32) I assume this is trying to call the function from ppdev.c in the linux source code, am I right on this? If so then that method does not exist and should be "pp_ioctl" Can someone verify this for me please ? -- George H george.dma at gmail.com From cppgent0 at gmail.com Mon May 24 16:59:09 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Mon, 24 May 2010 15:59:09 -0700 Subject: [Rxtx] lockfile Message-ID: Hi, I have gotten RXTX 1.5-8 (using import gnu.io.*): laptop:~/$ sudo java -noverify -cp extensions/RXTXcomm.jar -jar x.jar RXTX-1.5-8 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 to work with Java 1.6: laptop:~$ java -version java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02) I have a null modem cable between two computers both running Ubuntu 9.10. Typing into minicom on one gets characters coming out on the other running RXTX. So far so good. A couple more things though ... 1) I've searched google and the ubuntu forums + RXTX forums for solutions to the "Illegal use of non-virtual function call", they suggest using " java -noverify" but imply that the problem is fixed in RXTX versions later than 1.4. I'm using 1.5 but have the same issue. laptop:~/$ sudo java -cp extensions/RXTXcomm.jar -jar pakmon.jar RXTX-1.5-8 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 portid: gnu.io.CommPortIdentifier at 50988 Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call Any other options? 2) The lockfile is only working if I run java under root (i.e. using sudo in Ubuntu). a) I checked the lock file permissions. From this message: RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 it looks like '/var/lock' is the lock directory. Here are the permissions: laptop:/var$ ls -al /var/lock drwxrwxrwt 2 root root 40 2010-05-24 15:45 . drwxr-xr-x 16 root root 4096 2010-05-04 11:46 .. i.e. the permissions are wide open for /var/lock b) My user id is part of uucp group: laptop:/var$ id jaxxx uid=1000(jaxxx) gid=1000(jaxxx) groups=1000(jaxxx),4(adm),10(uucp),20(dialout),21(fax),24(cdrom),30(dip),46(plugdev),104(lpadmin),112(netdev),115(admin),120(sambashare) And after adding my userid to the uucp group I rebooted so everything is there. But without using sudo I still get the message: laptop:~/$ java -noverify -cp extensions/RXTXcomm.jar -jar pakmon.jar RXTX-1.5-8 0 -1216889792 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL What else should I try to get this to work under my local userid? Thanks for your help, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From cppgent0 at gmail.com Mon May 24 17:30:28 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Mon, 24 May 2010 16:30:28 -0700 Subject: [Rxtx] lockfile In-Reply-To: References: Message-ID: I upgraded to RXTX-2.1-7 and it all works just fine: laptop:~/$ java -jar xx.jar Experimental: JNI_OnLoad called. RXTX-2.1-7 Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 portid: gnu.io.CommPortIdentifier at 1bcdbf6 (Yeah you knew this email was coming! :) Thanks anyway, John On Mon, May 24, 2010 at 3:59 PM, J Arrizza wrote: > Hi, > > I have gotten RXTX 1.5-8 (using import gnu.io.*): > > laptop:~/$ sudo java -noverify -cp extensions/RXTXcomm.jar -jar x.jar > > RXTX-1.5-8 > RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 > Found port: /dev/ttyS0 > > > to work with Java 1.6: > > > laptop:~$ java -version > java version "1.6.0_20" > Java(TM) SE Runtime Environment (build 1.6.0_20-b02) > > > > I have a null modem cable between two computers both running Ubuntu 9.10. > Typing into minicom on one gets characters coming out on the other running > RXTX. So far so good. > > A couple more things though ... > > 1) I've searched google and the ubuntu forums + RXTX forums for solutions > to the "Illegal use of non-virtual function call", they suggest using " java > -noverify" but imply that the problem is fixed in RXTX versions later than > 1.4. I'm using 1.5 but have the same issue. > > laptop:~/$ sudo java -cp extensions/RXTXcomm.jar -jar pakmon.jar > RXTX-1.5-8 > RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 > Found port: /dev/ttyS0 > portid: gnu.io.CommPortIdentifier at 50988 > Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal > use of nonvirtual function call > > > Any other options? > > 2) The lockfile is only working if I run java under root (i.e. using sudo > in Ubuntu). > > a) I checked the lock file permissions. From this message: > > RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 > > > it looks like '/var/lock' is the lock directory. Here are the permissions: > > laptop:/var$ ls -al /var/lock > drwxrwxrwt 2 root root 40 2010-05-24 15:45 . > drwxr-xr-x 16 root root 4096 2010-05-04 11:46 .. > > > i.e. the permissions are wide open for /var/lock > > b) My user id is part of uucp group: > > laptop:/var$ id jaxxx > uid=1000(jaxxx) gid=1000(jaxxx) > groups=1000(jaxxx),4(adm),10(uucp),20(dialout),21(fax),24(cdrom),30(dip),46(plugdev),104(lpadmin),112(netdev),115(admin),120(sambashare) > > > And after adding my userid to the uucp group I rebooted so everything is > there. > > But without using sudo I still get the message: > > laptop:~/$ java -noverify -cp extensions/RXTXcomm.jar -jar pakmon.jar > RXTX-1.5-8 > 0 -1216889792 > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > > What else should I try to get this to work under my local userid? > > > Thanks for your help, > John > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ra85551 at gmail.com Fri May 14 08:51:34 2010 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Fri, 14 May 2010 18:51:34 +0400 Subject: [Rxtx] problem with compiling RXTX for OpenWrt 10.03 host Message-ID: Hello, I try to compile RXTX for use on OpenWrt box. ./configure --host=mipsel-openwrt-linux --prefix=/home/pavel/rxtx2.2-bin make But I've been got a following error: mipsel-openwrt-linux-gcc -I/home/pavel/rxtx-2.2pre2 -Imipsel-openwrt-linux-gnu -I. -I/opt/java/include -I/opt/java/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/pavel/rxtx-2.2pre2/./src/RawImp.c -fPIC -DPIC -o /home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/.libs/RawImp.o /home/pavel/rxtx-2.2pre2/./src/RawImp.c:104:20: sys/io.h: No such file or directory libtool: link: `/home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/RawImp.lo' is not a valid libtool object I've found no better solution than comment out entire line 104 in src/RawImp.c 104c104 < //#include --- > #include After that compilation has been succeeded. But is this the best way to compile? -- Pavel Parkhomenko From davestechshop at gmail.com Fri May 14 13:08:58 2010 From: davestechshop at gmail.com (Dave) Date: Fri, 14 May 2010 15:08:58 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux Message-ID: Here is some non-technical feedback about rxtx on two platforms. (I'm not a developer.) We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, but it has one problem we can't overcome. Windows: -------------------- 2.2pre2 on Windows crashes when the connected device is turned off or unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. Linux: -------------------- The best way I can explain the 2.2.pre2 problem on Linux is to paste this: "Tell them the read on the inputstream doesn't block, and when you enable the receiveTimeout, it gets forgotten after the first bytes are received [and it cannot be re-asserted]." Workarounds: -------------------- A workaround for the problem is possible on Windows, but we haven't found one for Linux. Our code is doing something that is not done by the example code generous people on this list helped me with. Our code receives many serial input events over 24 hours without intentionally disconnecting. The receiveTimeout problem is only evident after the first data packet is complete and the connection remains open for some time. Furthermore, if the instrument is disconnected, our app needs to wait and reconnect when the instrument becomes available. rxtx 2.2pre2 will not do this (on Windows). However, 2.1.7 will handle the disconnect and recover. The biggest problem for us is 2.2pre2 on Linux because we haven't found any workaround yet. We can't go back to 2.1.7 on Linux either (because it apparently doesn't work). Wish I could say something that would be more meaningful to you guys (especially the devs), but I hope what I have said is of value to someone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 15 00:52:11 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 15 May 2010 08:52:11 +0200 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: 2010/5/14 Dave > Here is some non-technical feedback about rxtx on two platforms. (I'm not a > developer.) > > We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, > but it has one problem we can't overcome. > > Windows: > -------------------- > 2.2pre2 on Windows crashes when the connected device is turned off or > unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. > Hi Dave Sorry - I don't agree with above description - I have had more problems with 2.1.7... I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting USB dongle if I am using software construction shown in my previous examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. Everything is to safelly catch in Java and reconnect! There are several things more while working with system's suspend's as well. I have observed (mainly in W7) that small activity of the COM channel may results in VCP driver deactivation (or somethnig like that). Therefore I have prepared my external device to generate dummy data (SW software version) in declared time intervals. Problems has gone... In Vista there were enough to disable energy saving on USB ports in notebook - this problem wasn't observed on desktop. Regards Mariusz > Linux: > -------------------- > The best way I can explain the 2.2.pre2 problem on Linux is to paste this: > > "Tell them the read on the inputstream doesn't block, and when you enable > the receiveTimeout, it gets forgotten after the first bytes are received > [and it cannot be re-asserted]." > > Workarounds: > -------------------- > A workaround for the problem is possible on Windows, but we haven't found > one for Linux. > > Our code is doing something that is not done by the example code generous > people on this list helped me with. Our code receives many serial input > events over 24 hours without intentionally disconnecting. The receiveTimeout > problem is only evident after the first data packet is complete and the > connection remains open for some time. > > Furthermore, if the instrument is disconnected, our app needs to wait and > reconnect when the instrument becomes available. rxtx 2.2pre2 will not do > this (on Windows). However, 2.1.7 will handle the disconnect and recover. > > The biggest problem for us is 2.2pre2 on Linux because we haven't found any > workaround yet. We can't go back to 2.1.7 on Linux either (because it > apparently doesn't work). > > Wish I could say something that would be more meaningful to you guys > (especially the devs), but I hope what I have said is of value to someone. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Sat May 15 02:30:49 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 08:30:49 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 Message-ID: Hi, I just wanted to know why the parallel port dll for windows is missing in the pre2.2 binary package? Does anyone have it compiled and working? Thanks -- George H george.dma at gmail.com From george.dma at gmail.com Sat May 15 03:33:08 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 09:33:08 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 In-Reply-To: References: Message-ID: On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked?? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > From mariusz.dec at gmail.com Sat May 15 05:38:29 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 15 May 2010 13:38:29 +0200 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 References: Message-ID: <57E4C18871C249EC82846512B38F121D@mdam2> Hi, I have just compiled it, but my RXTX 2.2 pre hasn't last CVS's. Do you have any FTP? Many mail relay servers blocks mails with dll's. Regards Mariusz ----- Original Message ----- From: "George H" To: "rxtx" Sent: Saturday, May 15, 2010 11:33 AM Subject: Re: [Rxtx] ParallelPort dll missing for windows in pre2.2 On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From davestechshop at gmail.com Sat May 15 15:04:02 2010 From: davestechshop at gmail.com (Dave) Date: Sat, 15 May 2010 17:04:02 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: Your example code was very, very helpful. However, the developer told me that your example code does not test the scenarios we are encountering. I'll see if I can get him to post a little more info. Sorry I don't have more to add at this time. Dave On Sat, May 15, 2010 at 2:52 AM, Mariusz Dec wrote: > > > 2010/5/14 Dave > > Here is some non-technical feedback about rxtx on two platforms. (I'm not a >> developer.) >> >> We can't get 2.2pre2 to work reliably on Windows. It works better on >> Linux, but it has one problem we can't overcome. >> >> Windows: >> -------------------- >> 2.2pre2 on Windows crashes when the connected device is turned off or >> unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. >> > > Hi Dave > > Sorry - I don't agree with above description - I have had more problems > with 2.1.7... > > I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting > USB dongle if I am using software construction shown in my previous > examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. > Everything is to safelly catch in Java and reconnect! > > There are several things more while working with system's suspend's as > well. > > I have observed (mainly in W7) that small activity of the COM channel may > results in VCP driver deactivation (or somethnig like that). > Therefore I have prepared my external device to generate dummy data (SW > software version) in declared time intervals. > Problems has gone... > In Vista there were enough to disable energy saving on USB ports in > notebook - this problem wasn't observed on desktop. > > > Regards > Mariusz > > >> Linux: >> -------------------- >> The best way I can explain the 2.2.pre2 problem on Linux is to paste this: >> >> "Tell them the read on the inputstream doesn't block, and when you enable >> the receiveTimeout, it gets forgotten after the first bytes are received >> [and it cannot be re-asserted]." >> >> Workarounds: >> -------------------- >> A workaround for the problem is possible on Windows, but we haven't found >> one for Linux. >> >> Our code is doing something that is not done by the example code generous >> people on this list helped me with. Our code receives many serial input >> events over 24 hours without intentionally disconnecting. The receiveTimeout >> problem is only evident after the first data packet is complete and the >> connection remains open for some time. >> >> Furthermore, if the instrument is disconnected, our app needs to wait and >> reconnect when the instrument becomes available. rxtx 2.2pre2 will not do >> this (on Windows). However, 2.1.7 will handle the disconnect and recover. >> >> The biggest problem for us is 2.2pre2 on Linux because we haven't found >> any workaround yet. We can't go back to 2.1.7 on Linux either (because it >> apparently doesn't work). >> >> Wish I could say something that would be more meaningful to you guys >> (especially the devs), but I hope what I have said is of value to someone. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon May 17 08:36:43 2010 From: george.dma at gmail.com (George H) Date: Mon, 17 May 2010 14:36:43 +0000 Subject: [Rxtx] Printing hangs when sending data to parallel port Message-ID: Hi, I am getting a really weird and annoying problem and I have exhausted all options. I am using rxtx pre2.2 on linux. I am connecting to a receipt printer on a parallel port (/dev/lp0) The receipt printer has a 4.0Kb data buffer Here's the problem. In my java program when I send it bytes (and I do a .flush() after each invocation of .write(byte[])) it prints the data but stops arbitrarily during the print process. I wait a bit... re-send the data to get printed. 1 out of 3 times it succeeds and prints everything. But with long data it has problems. Now here is the weird part. I create a text file with 7Kb of text data. I run the command "cat test.txt > /dev/lp0" and the printer prints everything in 1 go without any problems. So I don't know, I am thinking maybe this is a problem with rxtx ? maybe I need to set some parallel parameters? Or should I try reverting to the 2.1 version of rxtx if the parallel code is more reliable? Thanks for helping -- George H george.dma at gmail.com From george.dma at gmail.com Tue May 18 00:16:54 2010 From: george.dma at gmail.com (George H) Date: Tue, 18 May 2010 09:16:54 +0300 Subject: [Rxtx] Printing hangs when sending data to parallel port In-Reply-To: References: Message-ID: On Mon, May 17, 2010 at 5:36 PM, George H wrote: > Hi, > > I am getting a really weird and annoying problem and I have exhausted > all options. I am using rxtx pre2.2 on linux. > I am connecting to a receipt printer on a parallel port (/dev/lp0) The > receipt printer has a 4.0Kb data buffer > > Here's the problem. In my java program when I send it bytes (and I do > a .flush() after each invocation of .write(byte[])) it prints the data > but stops arbitrarily during the print process. I wait a bit... > re-send the data to get printed. 1 out of 3 times it succeeds and > prints everything. But with long data it has problems. > > Now here is the weird part. I create a text file with 7Kb of text > data. I run the command ? "cat test.txt > /dev/lp0" and the printer > prints everything in 1 go without any problems. > > So I don't know, I am thinking maybe this is a problem with rxtx ? > maybe I need to set some parallel parameters? Or should I try > reverting to the 2.1 version of rxtx if the parallel code is more > reliable? > > Thanks for helping After testing we found out that we need to send the text to the printer as UTF8 bytes and best to include a 50ms blocking parameter when connecting to the parallel port. So I'm glad to say that rxtx was not the problem, just me not knowing the above were a requirement. > > -- > George H > george.dma at gmail.com > From george.dma at gmail.com Wed May 19 11:17:55 2010 From: george.dma at gmail.com (George H) Date: Wed, 19 May 2010 17:17:55 +0000 Subject: [Rxtx] Resource temporarily unavailable on writeByte() Message-ID: Hi, This affects rxtx 2.1.7 and 2.2pre2 I have a POS receipt printer connected via parallel port. The BIOS is set to use SPP more for the parallel port. I am sending bytes to the parallel outputstream using the out.write(int b) method and just for safety I call flush after each write.. out.write(b); out.flush(); When I queue up arrays of bytes to be written that way, it will keep printing and then throw a "java.io.IOException: Resource temporarily unavailable in writeByte" all the time. I did a dirty workaround by pausing 2 seconds between printing receipts and it seems to postpone the error from happening, but it still happens. I thought it was maybe a threading problem from my app... so I made a program to just skip all the threading stuff and just print directly. Same problem. The below exception was thrown when using the 2.1.7 version of rxtx java.io.IOException: Resource temporarily unavailable in writeArray com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2381) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) Caused by: Resource temporarily unavailable in writeArray gnu.io.LPRPort.writeArray(Native Method) gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:281) com.gi.pos.comm.parallel.ParallelCommWriter.write(ParallelCommWriter.java:62) com.gi.pos.comm.parallel.ParallelCommWriter.writeString(ParallelCommWriter.java:52) com.gi.pos.comm.POSCommPort.writeString(POSCommPort.java:95) com.gi.resto.printer.RestoPOSPrinter.writeTwoStrings(RestoPOSPrinter.java:3045) com.gi.resto.printer.RestoPOSPrinter.writeCondimentString(RestoPOSPrinter.java:3074) com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2145) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) I've tried everything possible and also, I don't know if this is implemented or not but ParallelPort.isPrinterBusy() always returns false, is this normal? And it seems rxtx setting the parallel mode to EPP or ECP always throws and exception even though my bios supports those modes. Please help, this is frustrating :S -- George H george.dma at gmail.com From thomas.shulok at lmco.com Wed May 19 18:40:38 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Wed, 19 May 2010 18:40:38 -0600 Subject: [Rxtx] lock files, expected behavior? Message-ID: Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 05:05:41 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 20 May 2010 13:05:41 +0200 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, > > > > I know there are a ton of questions about lock files (I think I?ve read all > of them at this point J, but my question is slightly different. In my > application, I initially do a CommPortIdentifier.*getPortIdentifiers*(), > and I get back all my expected com ports. No problem there. Subsequently, > I acquire a port via CommPortIdentifier.*open*(). No problem. But now, > when I do a subsequent CommPortIdentifier.*getPortIdentifiers*(), the port > I acquired is no longer included in the returned enumeration. For the port > in question, the call to getPortIdentifiers produces > > > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File > exists > > > > in the log. Everything I?m doing is in one process space. I?ve confirmed > that my PID and the PID inside the lock file are the same. Does the > implementation check to see if the PID in the lock file is the same as the > PID of the caller, or does it merely check for the existence of the lock > file and bail, regardless of who the caller is? Or am I missing something > else? > > > > Thanks, > > Thom > > (rxtx-2.1.7-r2) > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.shulok at lmco.com Thu May 20 07:43:13 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 20 May 2010 07:43:13 -0600 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Thu May 20 07:44:35 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Thu, 20 May 2010 15:44:35 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Message-ID: Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 07:56:34 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 15:56:34 +0200 Subject: [Rxtx] lock files, expected behavior? References: Message-ID: <81AA8C26A14E43279758AA42434576D9@mdam2> Hi, sorry for previous miss-click :) Shared access to serial ports is very diffucult even if native OS. IMHO this should be done at least in JNI or LOWER/DEEPER in OS, but I don't think that RXTX does it (I am not a developer, only user). So I can only suggest to join Java applications (processes) and sort data inside joined application. Regards Mariusz ----- Original Message ----- From: Shulok, Thomas To: Mariusz Dec Cc: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:43 PM Subject: RE: [Rxtx] lock files, expected behavior? Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point J, but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 08:26:43 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 16:26:43 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver References: Message-ID: <33FE508874504BF4B3A636FCF120D7C0@mdam2> Hi, If you have copied only final jre there is not enough. Installation of the RXTX bins must be compatible with local Java and/or system paths... This is of course theory, because Java is platform independent . In w7-32 there is enough to copy rxtxSerial.dll to Windows/system32 or to Java jre folders something like that: ....Java\jre6\bin\rxtxSerial.dll Regards Mariusz ----- Original Message ----- From: Hans Rupp To: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:44 PM Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu May 20 17:02:09 2010 From: george.dma at gmail.com (George H) Date: Thu, 20 May 2010 23:02:09 +0000 Subject: [Rxtx] Possible bug in ParallelImp.c Message-ID: Hi, I been looking for a reason why .isPrinterBusy() method always returns false for me and I was looking at the ParallelImp.c class and found this #if defined (__linux__) ioctl(fd, LPGETSTATUS, &status); #elif defined (WIN32) I assume this is trying to call the function from ppdev.c in the linux source code, am I right on this? If so then that method does not exist and should be "pp_ioctl" Can someone verify this for me please ? -- George H george.dma at gmail.com From cppgent0 at gmail.com Mon May 24 16:59:09 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Mon, 24 May 2010 15:59:09 -0700 Subject: [Rxtx] lockfile Message-ID: Hi, I have gotten RXTX 1.5-8 (using import gnu.io.*): laptop:~/$ sudo java -noverify -cp extensions/RXTXcomm.jar -jar x.jar RXTX-1.5-8 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 to work with Java 1.6: laptop:~$ java -version java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02) I have a null modem cable between two computers both running Ubuntu 9.10. Typing into minicom on one gets characters coming out on the other running RXTX. So far so good. A couple more things though ... 1) I've searched google and the ubuntu forums + RXTX forums for solutions to the "Illegal use of non-virtual function call", they suggest using " java -noverify" but imply that the problem is fixed in RXTX versions later than 1.4. I'm using 1.5 but have the same issue. laptop:~/$ sudo java -cp extensions/RXTXcomm.jar -jar pakmon.jar RXTX-1.5-8 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 portid: gnu.io.CommPortIdentifier at 50988 Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call Any other options? 2) The lockfile is only working if I run java under root (i.e. using sudo in Ubuntu). a) I checked the lock file permissions. From this message: RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 it looks like '/var/lock' is the lock directory. Here are the permissions: laptop:/var$ ls -al /var/lock drwxrwxrwt 2 root root 40 2010-05-24 15:45 . drwxr-xr-x 16 root root 4096 2010-05-04 11:46 .. i.e. the permissions are wide open for /var/lock b) My user id is part of uucp group: laptop:/var$ id jaxxx uid=1000(jaxxx) gid=1000(jaxxx) groups=1000(jaxxx),4(adm),10(uucp),20(dialout),21(fax),24(cdrom),30(dip),46(plugdev),104(lpadmin),112(netdev),115(admin),120(sambashare) And after adding my userid to the uucp group I rebooted so everything is there. But without using sudo I still get the message: laptop:~/$ java -noverify -cp extensions/RXTXcomm.jar -jar pakmon.jar RXTX-1.5-8 0 -1216889792 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL What else should I try to get this to work under my local userid? Thanks for your help, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From cppgent0 at gmail.com Mon May 24 17:30:28 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Mon, 24 May 2010 16:30:28 -0700 Subject: [Rxtx] lockfile In-Reply-To: References: Message-ID: I upgraded to RXTX-2.1-7 and it all works just fine: laptop:~/$ java -jar xx.jar Experimental: JNI_OnLoad called. RXTX-2.1-7 Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 portid: gnu.io.CommPortIdentifier at 1bcdbf6 (Yeah you knew this email was coming! :) Thanks anyway, John On Mon, May 24, 2010 at 3:59 PM, J Arrizza wrote: > Hi, > > I have gotten RXTX 1.5-8 (using import gnu.io.*): > > laptop:~/$ sudo java -noverify -cp extensions/RXTXcomm.jar -jar x.jar > > RXTX-1.5-8 > RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 > Found port: /dev/ttyS0 > > > to work with Java 1.6: > > > laptop:~$ java -version > java version "1.6.0_20" > Java(TM) SE Runtime Environment (build 1.6.0_20-b02) > > > > I have a null modem cable between two computers both running Ubuntu 9.10. > Typing into minicom on one gets characters coming out on the other running > RXTX. So far so good. > > A couple more things though ... > > 1) I've searched google and the ubuntu forums + RXTX forums for solutions > to the "Illegal use of non-virtual function call", they suggest using " java > -noverify" but imply that the problem is fixed in RXTX versions later than > 1.4. I'm using 1.5 but have the same issue. > > laptop:~/$ sudo java -cp extensions/RXTXcomm.jar -jar pakmon.jar > RXTX-1.5-8 > RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 > Found port: /dev/ttyS0 > portid: gnu.io.CommPortIdentifier at 50988 > Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal > use of nonvirtual function call > > > Any other options? > > 2) The lockfile is only working if I run java under root (i.e. using sudo > in Ubuntu). > > a) I checked the lock file permissions. From this message: > > RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 > > > it looks like '/var/lock' is the lock directory. Here are the permissions: > > laptop:/var$ ls -al /var/lock > drwxrwxrwt 2 root root 40 2010-05-24 15:45 . > drwxr-xr-x 16 root root 4096 2010-05-04 11:46 .. > > > i.e. the permissions are wide open for /var/lock > > b) My user id is part of uucp group: > > laptop:/var$ id jaxxx > uid=1000(jaxxx) gid=1000(jaxxx) > groups=1000(jaxxx),4(adm),10(uucp),20(dialout),21(fax),24(cdrom),30(dip),46(plugdev),104(lpadmin),112(netdev),115(admin),120(sambashare) > > > And after adding my userid to the uucp group I rebooted so everything is > there. > > But without using sudo I still get the message: > > laptop:~/$ java -noverify -cp extensions/RXTXcomm.jar -jar pakmon.jar > RXTX-1.5-8 > 0 -1216889792 > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > > What else should I try to get this to work under my local userid? > > > Thanks for your help, > John > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Thu May 27 18:08:13 2010 From: davestechshop at gmail.com (Dave) Date: Thu, 27 May 2010 20:08:13 -0400 Subject: [Rxtx] kernel panic on OS X Message-ID: Is anyone else seeing kernel panics on latest Mac OS X when disconnecting a serial device? I'm using rxtx (I've tried both 2.1-7 and 2.2pre2) and com.silabs.driver.SiLabsUSBDriver. I'm testing on a brand new clean iMac with latest OS updates. Disconnecting the serial device (a medical instrument) causes a hard crash. When I disconnect the device a certain number of times, the crash will happen. It could happen the first time or I have seen it be as many as ten times. The crash is always a kernel panic. The only variable is whether it happens on the first disconnect or the tenth, but it will happen. I'm not seeing this on WIndows or Linux (Ubuntu). Anyone else seeing anything like this? I am interested in engaging a Mac OS X expert as a consultant for up to several hours to help me resolve this. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rbreznak at neuronrobotics.com Thu May 27 18:25:54 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 27 May 2010 20:25:54 -0400 Subject: [Rxtx] kernel panic on OS X In-Reply-To: References: Message-ID: I have seen this as well on both my 24" iMac and 13" powerbook. ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com On Thu, May 27, 2010 at 8:08 PM, Dave wrote: > Is anyone else seeing kernel panics on latest Mac OS X when disconnecting a > serial device? I'm using rxtx (I've tried both 2.1-7 and 2.2pre2) > and com.silabs.driver.SiLabsUSBDriver. > > I'm testing on a brand new clean iMac with latest OS updates. Disconnecting > the serial device (a medical instrument) causes a hard crash. When I > disconnect the device a certain number of times, the crash will happen. It > could happen the first time or I have seen it be as many as ten times. The > crash is always a kernel panic. The only variable is whether it happens on > the first disconnect or the tenth, but it will happen. > > I'm not seeing this on WIndows or Linux (Ubuntu). > > Anyone else seeing anything like this? I am interested in engaging a Mac OS > X expert as a consultant for up to several hours to help me resolve this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Thu May 27 18:57:49 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Fri, 28 May 2010 10:57:49 +1000 Subject: [Rxtx] kernel panic on OS X In-Reply-To: References: Message-ID: <4BFF150D.5060900@shikadi.net> > Is anyone else seeing kernel panics on latest Mac OS X when > disconnecting a serial device? I'm using rxtx (I've tried both 2.1-7 and > 2.2pre2) and com.silabs.driver.SiLabsUSBDriver. FWIW I've seen this under Linux with one of the USB serial drivers. If you disconnected the USB device while the serial port was open, it would often cause a kernel crash. This was a simple bug in the device driver, and it was fixed in a later kernel version. Sounds like a similar issue. It should be fairly easy to fix if the driver is open source and you can find someone with kernel debugging experience. Cheers, Adam. From davestechshop at gmail.com Thu May 27 19:40:09 2010 From: davestechshop at gmail.com (Dave) Date: Thu, 27 May 2010 21:40:09 -0400 Subject: [Rxtx] kernel panic on OS X In-Reply-To: <4BFF150D.5060900@shikadi.net> References: <4BFF150D.5060900@shikadi.net> Message-ID: On Thu, May 27, 2010 at 8:57 PM, Adam Nielsen wrote: > Is anyone else seeing kernel panics on latest Mac OS X when disconnecting >> a serial device? I'm using rxtx (I've tried both 2.1-7 and 2.2pre2) and >> com.silabs.driver.SiLabsUSBDriver. >> > > FWIW I've seen this under Linux with one of the USB serial drivers. If you > disconnected the USB device while the serial port was open, it would often > cause a kernel crash. > > This was a simple bug in the device driver, and it was fixed in a later > kernel version. Sounds like a similar issue. It should be fairly easy to > fix if the driver is open source and you can find someone with kernel > debugging experience. > > Cheers, > Adam. > > I am not finding driver source code for the Mac drivers... Here's something I ran across in my research. Customizing Driver Installations, Macintosh OS9 and OSX If the vendor ID or product ID is changed from the default factory settings, > contact Silicon Laboratories to obtain drivers that incorporate the new > values. Macintosh requires that the drivers be compiled with the values that > will be used by the production CP210x device. In the diagnostic report, I see this value: USB Device: CP2103 USB to UART Bridge Controller, *0x10c4* (Silicon Laboratories, Inc.), *0xea60*, 0xfa141000 I wonder if those would be the vendor ID or product ID? The *0x10c4 and 0xea60* values appear in the standard SiLabs docs, so maybe that indicates that the he vendor ID and product ID are *not* changed from the default factory settings. So maybe this means nothing, but I'll post it in case it help anyone else with this issue. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which platform are you working. > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? So, now I get the impression, that RXTX might have a problem here... Why? Whenever I run my program normally, I get one of various exceptions. So, I think, the exception itself cannot tell anything about the error. In particular, I also got the port in use exception -- but the port has not been in use! Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works perfectly. I tried this a couple of times: debugger: it works, running normally: I get an exception. There is one other mysterious thing I don't understand: If I run the program in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on linux does no longer work.... Maybe this is a hint, which I found in /var/log/messages kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported Do you have any explanation? /Karl From jdp at syntelos.org Fri May 7 14:45:19 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 7 May 2010 16:45:19 -0400 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005072108.31331.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: Karl, Just saw your message. The open port would sound like not closing on termination. The debugger friendly software can be a number of things. First thing to think about for me is in the multithreading neighborhood. Second thing is how the execution path or sequence can change with a variation in thread context switching performance (ever done MT on PPC vs Intel vs SPARC? The PPC context switches are so fast that sensitive MT code will trip and fall). Likewise the debugger may be using green (soft) threads -- if memory serves. Hope this is useful, John On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > > 2010/5/7 Karl Weber > > > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: > [...] > > > > I have seen many times that bluetooth trough COM ports works with some > > unpredictable problems - quality of the drivers. > > > > Did you see also timing problems? > > > In this last case (Invalid Parameter) I suppose to check available speeds > > The parameters are o.k. I know now, see below. > > > > > I don't know on which platform are you working. > > > > openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? > > So, now I get the impression, that RXTX might have a problem here... Why? > > Whenever I run my program normally, I get one of various exceptions. So, I > think, the exception itself cannot tell anything about the error. In > particular, I also got the port in use exception -- but the port has not > been > in use! > > Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works > perfectly. > > I tried this a couple of times: debugger: it works, running normally: I get > an > exception. > > There is one other mysterious thing I don't understand: If I run the > program > in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on > linux does no longer work.... > > Maybe this is a hint, which I found in /var/log/messages > > kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported > > Do you have any explanation? > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 8 00:54:47 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 08:54:47 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> <201005072108.31331.karl.weber99@gmx.net> Message-ID: 2010/5/7 John Pritchard Karl, > > Just saw your message. The open port would sound like not closing on > termination. > I have described in November'2009 open/close tricks. This sample confirms proper opening/closing ports and driver/system specific configuration. Try it.... I will continue below in your previous post Mariusz > > The debugger friendly software can be a number of things. First thing to > think about for me is in the multithreading neighborhood. Second thing is > how the execution path or sequence can change with a variation in thread > context switching performance (ever done MT on PPC vs Intel vs SPARC? The > PPC context switches are so fast that sensitive MT code will trip and > fall). Likewise the debugger may be using green (soft) threads -- if memory > serves. > > Hope this is useful, > > John > > > > On Fri, May 7, 2010 at 3:08 PM, Karl Weber wrote: > >> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: >> > 2010/5/7 Karl Weber >> > >> > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: >> [...] >> > >> > I have seen many times that bluetooth trough COM ports works with some >> > unpredictable problems - quality of the drivers. >> > >> >> Did you see also timing problems? >> > Probably something like that. Example - good tested software looks for specific RS device checking all available COM ports. If bluetooth is on the list, software hangs or not. It means that test command sended from host stays in BT driver like in black hole OUTSIDE application, only hard terminate of the app is available. > >> > In this last case (Invalid Parameter) I suppose to check available >> speeds >> >> The parameters are o.k. I know now, see below. >> >> > >> > I don't know on which platform are you working. >> > >> >> openSUSE 11.1, RXTX 2.2pre2, I guess, 64 bit PC. Do you need to know more? >> > I asked to compare with my easy available systems if I may try your configuration. In my 32 bit Ubuntu I have seen sometimes that pid file was not deleted after close, but after changes in RXTX configuration parameters it has gone. Refer to my example from November. > >> So, now I get the impression, that RXTX might have a problem here... Why? >> >> Whenever I run my program normally, I get one of various exceptions. So, I >> think, the exception itself cannot tell anything about the error. In >> particular, I also got the port in use exception -- but the port has not >> been >> in use! >> >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it works >> perfectly. >> > IMHO - This effect confirms some problems with threads. > >> I tried this a couple of times: debugger: it works, running normally: I >> get an >> exception. >> >> There is one other mysterious thing I don't understand: If I run the >> program >> in the debugger and let it finish, then afterwards the cat /dev/rfcomm0 on >> linux does no longer work.... >> >> Maybe stays open after debugging. > Maybe this is a hint, which I found in /var/log/messages >> >> kernel: rfcomm_tty_ioctl: TIOCSERGETLSR is not supported >> > >> Do you have any explanation? >> > Sorry, I don't know Linux kernels and TIOC functions so deep :(. The only way is to try discover role of this "SERial GET LSR" and look for it in RXTX to work around. But start from my simple example (attached)- this piece of code has already helped several peoples here in last months. Regards Mariusz > >> /Karl >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From karl.weber99 at gmx.net Sat May 8 03:03:59 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Sat, 8 May 2010 11:03:59 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005081103.59168.karl.weber99@gmx.net> Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > 2010/5/7 John Pritchard > [...] > >> > >> > I have seen many times that bluetooth trough COM ports works with some > >> > unpredictable problems - quality of the drivers. > >> > >> Did you see also timing problems? > > Probably something like that. I think I narrowed the problem down a little bit. The following experiments do not involve any debugging, the program runs normally. My program has a connect() method that looks as given by Mariusz in the previous post, only three lines were missing: setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) setDTR(false) setRTS(reue) It does not make any difference to add them. However: It found out, that there seems to be exactly one point where I have to wait, namely between portIdentifier.open(...) and isCurrentlyOwned() Compare the code from Mariusz. I added a Thread.sleep(time) before open. If time >= 100, things work smoothly. If time <= 75 I start to get exceptions. Not always, but more often the smaller time gets. As mentioned before, I get different kinds of exceptions and the same exception with different message texts. One is, e.g., portInUseException with the text "Unknown linux application"..... Huh? How can it be, that I get a portInUseException before open() if I sleep less than 100 msec between isCurrentlyOwned() and open()? Note, that I checked before I started the program, that the port is not in use. [...] > >> > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > >> works perfectly. > > IMHO - This effect confirms some problems with threads. > May be, but where? In my program, in RXTX or even in my kernel? It cannot be my program, since the problem lies in the connect() method, before open(), see above. At that time my program has only one user thread. The Reader thread, e.g., is started later. Furthermore, my program is well tested and extensively used for more than six months with the USB interface. In particular, closing works properly with USB. Problems only occur with bluetooth. > > But start from my simple example (attached)- this piece of code has already > helped several peoples here in last months. > Regards > Mariusz > Great many thanks for this example. It is pretty close to my program. Well, I close the port before I close the streams, you do it afterwards. I will try whether it makes any difference. /Karl From mariusz.dec at gmail.com Sat May 8 03:58:27 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 8 May 2010 11:58:27 +0200 Subject: [Rxtx] Fwd: RXTX not working with bluetooth on linux In-Reply-To: <201005081103.59168.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005081103.59168.karl.weber99@gmx.net> Message-ID: 2010/5/8 Karl Weber > Am Samstag, 8. Mai 2010 08:54 schrieb Mariusz Dec: > > 2010/5/7 John Pritchard > > > [...] > > >> > > >> > I have seen many times that bluetooth trough COM ports works with > some > > >> > unpredictable problems - quality of the drivers. > > >> > > >> Did you see also timing problems? > > > > Probably something like that. > > I think I narrowed the problem down a little bit. The following experiments > do > not involve any debugging, the program runs normally. > > My program has a connect() method that looks as given by Mariusz in the > previous post, only three lines were missing: > > setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_OUT) > setDTR(false) > setRTS(reue) > > It does not make any difference to add them. > > However: It found out, that there seems to be exactly one point where I > have > to wait, namely between > > portIdentifier.open(...) > and > isCurrentlyOwned() > > What I have found in sources - IsCurrentlyOwned reacts on RXTX ownership. "Ouitside" Java ownership works a bit magically.... sometimes works, sometimes not, but I have ignored this problem and my application works on Win/Lx/Mac without big problems. Finally I am using open() exceptions to determine if port is owned or not - it works very fine. Very important is that I am using only a VERY GOOD RS(VCP) -USB interface and drivers from FTDI. You haven't this possibility when third party BT device is in use. > Compare the code from Mariusz. I added a Thread.sleep(time) before open. If > time >= 100, things work smoothly. If time <= 75 I start to get exceptions. > This looks that your order of starting threads/tasks isn't proper. > Not always, but more often the smaller time gets. As mentioned before, I > get > different kinds of exceptions and the same exception with different message > texts. One is, e.g., portInUseException with the text "Unknown linux > application"..... Huh? > > How can it be, that I get a portInUseException before open() if I sleep > less > than 100 msec between isCurrentlyOwned() and open()? Note, that I checked > before I started the program, that the port is not in use. > > [...] > > >> > > >> Whenever I run my program in the debugger -- i.e. slowly(!!!) -- it > > >> works perfectly. > > > > IMHO - This effect confirms some problems with threads. > > > > May be, but where? In my program, in RXTX or even in my kernel? > Who knows? I am voting on BT driver :(. Two days ago we have tryed my application with Java64 on the Macintosh for the first time. RS-part works very fine except situations when you disconnect USB while RXTX is in use - process pid file stays active - this is clear. Windows hasn't pid file and therefore comes back to proper work (after re-open) without terminating of the application. > It cannot be my program, since the problem lies in the connect() method, > before open(), see above. At that time my program has only one user thread. > The Reader thread, e.g., is started later. > > Furthermore, my program is well tested and extensively used for more than > six > months with the USB interface. In particular, closing works properly with > USB. Problems only occur with bluetooth. > > > > > But start from my simple example (attached)- this piece of code has > already > > helped several peoples here in last months. > > Regards > > Mariusz > > > > Great many thanks for this example. It is pretty close to my program. Well, > I > close the port before I close the streams, you do it afterwards. I will try > whether it makes any difference. > THIS IS VERY BIG DIFFERENCE - I have worked over my app and did an example after 2 months of discovering problem. !!!!! Order of operations is very important. !!!!! Streams are 'connected to'/'integrated with' COM "engine" and are 'OVER' COM engne!!!! If you try to close COM, what would streams to do??? So try to copy MY operations ORDER while opening as well. Mariusz > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Mon May 10 06:55:52 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Mon, 10 May 2010 22:55:52 +1000 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 Message-ID: <4BE80258.3060602@shikadi.net> Hi all, I'm trying to get RXTX working in conjunction with the SUMP open source logic analyser, but every time I try to perform a capture (which is where RXTX comes in) my Java VM crashes: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0791877462, pid=26069, tid=139670486251280 # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 ... Stack: [0x00007f0791a7f000,0x00007f0791b80000], sp=0x00007f0791b7e5c0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [librxtxSerial.so+0x6462] read_byte_array+0x52 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.readByte()I+0 j gnu.io.RXTXPort$SerialInputStream.read()I+61 j org.sump.analyzer.Device.readInteger()I+11 j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 j org.sump.analyzer.DeviceController.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub I've tried the version distributed with my Linux distro as well as the version downloaded from the rxtx website but there's no change. I've tried a couple of different Java versions but that didn't change anything either. Does anyone know what's the problem might be? Thanks, Adam. From jdp at syntelos.org Mon May 10 09:21:06 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 10 May 2010 11:21:06 -0400 Subject: [Rxtx] SIGSEGV in read_byte_array+0x52 In-Reply-To: <4BE80258.3060602@shikadi.net> References: <4BE80258.3060602@shikadi.net> Message-ID: > j gnu.io.RXTXPort.readByte()I+0 > j gnu.io.RXTXPort$SerialInputStream.read()I+61 > j org.sump.analyzer.Device.readInteger()I+11 > j org.sump.analyzer.Device.run()Lorg/sump/analyzer/CapturedData;+31 > j org.sump.analyzer.DeviceController.run()V+58 > j java.lang.Thread.run()V+11 > > >From looking at this I'd guess the first path is to check with folks at sump.org about using RXTX. Looks like their code may be doing something that RXTX native code isn't tolerating? (Read past the end of the byte[] buffer array? that's pretty weird. esp for an integer. may be a buffer handling bug of theirs.) RXTX has been on the same version for years, so for that reason I expect that there's no issue with its versions. Couple notes, may be useful. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Mon May 10 14:32:27 2010 From: davestechshop at gmail.com (Daves TechShop) Date: Mon, 10 May 2010 16:32:27 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost Message-ID: I'm trying to set rxtxSerial to work on openSUSE so that a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). After a lot of trouble shooting I arrived at the possibility that I needed to be using the Sun jre. When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have now tried openJDK and Sun. Both fail but with completely different messages, which I will share below. Any help is appreciated. /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java ----------------------------------------------- [CODE]check_group_uucp(): error testing lock file creation Error details:Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that. cat /etc/group uucp:x:14:dave /usr/lib64/jvm/jre-1.6.0-sun/bin/java ----------------------------------------------- [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: ls -la /usr/lib64/jvm/jre/lib/ext/ total 1244 drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) copy librxtxSerial.so to /usr/lib64 (done) dmesg ... [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address 2 [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller [ 661.353443] usb 4-1: Manufacturer: Silicon Labs [ 661.353453] usb 4-1: SerialNumber: 0001 [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice [ 661.726229] usbcore: registered new interface driver usbserial [ 661.726356] USB Serial support registered for generic [ 661.726488] usbcore: registered new interface driver usbserial_generic [ 661.726508] usbserial: USB Serial Driver core [ 661.735335] USB Serial support registered for cp210x [ 661.735386] cp210x 4-1:1.0: cp210x converter detected [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 [ 661.969417] usbcore: registered new interface driver cp210x [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 15:07:08 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 10 May 2010 22:07:08 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: Message-ID: <20100510220708.67546e6f@workstation.site> which version of SUSE are you using. There is a problem with 11.2 that causes rxtx to fail. One solution is to compile the libs so that they DO NOT use file locking. Another is to allow var/lock to be world read/writable (I've never tried this solution) Thew changes are: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root previously: serial devices were root:uucp var/lock was root:uucp I did find a bugzilla entry on this ages ago: https://bugzilla.novell.com/show_bug.cgi?id=552095 Andy On Mon, 10 May 2010 16:32:27 -0400 Daves TechShop wrote: > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > After a lot of trouble shooting I arrived at the possibility that I needed > to be using the Sun jre. > > When I use update-alternatives --config java, there are 3 alternatives which > provide `java'. I have now tried openJDK and Sun. Both fail but with > completely different messages, which I will share below. > > Any help is appreciated. > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > ----------------------------------------------- > [CODE]check_group_uucp(): error testing lock file creation Error > details:Permission denied > check_lock_status: No permission to create lock file. > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is no > "INSTALL" file. However, I know the solution is supposed to be adding my > user to group uucp. I have done that. > > cat /etc/group > uucp:x:14:dave > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > ----------------------------------------------- > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have a > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > ls -la /usr/lib64/jvm/jre/lib/ext/ > total 1244 > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > copy librxtxSerial.so to /usr/lib64 (done) > > > dmesg > ... > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and address > 2 > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, idProduct=ea60 > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=3 > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > [ 661.353453] usb 4-1: SerialNumber: 0001 > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > [ 661.726229] usbcore: registered new interface driver usbserial > [ 661.726356] USB Serial support registered for generic > [ 661.726488] usbcore: registered new interface driver usbserial_generic > [ 661.726508] usbserial: USB Serial Driver core > [ 661.735335] USB Serial support registered for cp210x > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > [ 661.969417] usbcore: registered new interface driver cp210x > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver From davestechshop at gmail.com Mon May 10 15:49:48 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 17:49:48 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100510220708.67546e6f@workstation.site> References: <20100510220708.67546e6f@workstation.site> Message-ID: Andy, That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading your reply, I took the easy solution and made /var/lock world read/writable. That solved the error "No permission to create lock file". My java app starts up correctly now. However, it doesn't find the serial port. I can't understand why because dmesg shows lines that indicate all is well: > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and address 2 > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 ls /dev/tty* also shows ttyUSB0. But my app doesn't find any serial ports. It finds them correctly on Ubuntu as well as Windows. Is this another issue related to openSUSE 11.2? I didn't understand this part of your message: serial devices are now owned by root with a group of dialout var/lock is now owned by root with a group of root How do I change permissions on /dev/ttyUSB0 (if that is required)? Thanks Dave On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > which version of SUSE are you using. There is a problem with 11.2 that > causes rxtx to fail. > > One solution is to compile the libs so that they DO NOT use file locking. > > Another is to allow var/lock to be world read/writable (I've never tried > this solution) > > Thew changes are: > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > previously: > > serial devices were root:uucp > var/lock was root:uucp > > > I did find a bugzilla entry on this ages ago: > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > Andy > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > Daves TechShop wrote: > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > After a lot of trouble shooting I arrived at the possibility that I > needed > > to be using the Sun jre. > > > > When I use update-alternatives --config java, there are 3 alternatives > which > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > completely different messages, which I will share below. > > > > Any help is appreciated. > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > ----------------------------------------------- > > [CODE]check_group_uucp(): error testing lock file creation Error > > details:Permission denied > > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > no > > "INSTALL" file. However, I know the solution is supposed to be adding my > > user to group uucp. I have done that. > > > > cat /etc/group > > uucp:x:14:dave > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > ----------------------------------------------- > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > a > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > total 1244 > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > dmesg > > ... > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > address > > 2 > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > idProduct=ea60 > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > SerialNumber=3 > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > [ 661.726229] usbcore: registered new interface driver usbserial > > [ 661.726356] USB Serial support registered for generic > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > [ 661.726508] usbserial: USB Serial Driver core > > [ 661.735335] USB Serial support registered for cp210x > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > [ 661.969417] usbcore: registered new interface driver cp210x > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > driver > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at g0poy.com Mon May 10 17:37:57 2010 From: andy at g0poy.com (Andy Eskelson) Date: Tue, 11 May 2010 00:37:57 +0100 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511003757.68faa2e1@workstation.site> Dave, I see you have found the chmod 666 on the serial ports. That's a difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule that sets things up in that manner. It's easy enough to set up a rule on SUSE. Udev rules live in /etc/udev/rules.d/ if you ls that directory you will see things like 40-alsa.rules, 60-pcmcia.rules and so on. The number is the priority, lower numbers over-ride the higher numbers. The rules are simple text files. you need to do this as root: cd into /ect/udev/rules.d touch 10-local.rules then edit 10-local.rules add the following (edit the comments to taste) # # udev rules for local use # Main use is to allow access to the serial port hardware by users # Found this to be necessary for WxToImg to control the receiver # # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, ttyUSB1 # To 666 # KERNEL=="ttyUSB*", MODE="0666" Then any usb port will get the full permissions. There is a very good document regarding udev rules here: http://www.reactivated.net/writing_udev_rules.html The bit about serial devices owned by root with a group of dialout, and var/lock owned by root with a group of root, is the change to the owner and permissions. In Linux a file or directory has an owner, and a group. This gives access to the owner (obviously) and also gives access to anyone in group" If you look at the various settings for your linux users you will find that users can "belong" to a number of groups. previously serial devices were root:uucp var/lock was root:uucp So when a new serial port popped up into the list, it belonged to group uucp As var/lock also has a group of uucp, the lock file could be created without any problems. The change causes serial devices to be root:dialout and var/lock as root:root Effectively this prevents anything other than root creating a lock file. Not too helpful really. If this is a bit double dutch, give me a mail off list and I'll send you a document that I produced for the installation of the miniVNA network analyser group, which uses rxtx and is where I came across the SUSE issue. It's got a more detailed guide in it. Andy On Mon, 10 May 2010 17:49:48 -0400 Dave wrote: > Andy, > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After reading > your reply, I took the easy solution and made /var/lock world read/writable. > That solved the error "No permission to create lock file". > > My java app starts up correctly now. However, it doesn't find the serial > port. I can't understand why because dmesg shows lines that indicate all is > well: > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and address 2 > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > ls /dev/tty* also shows ttyUSB0. > But my app doesn't find any serial ports. It finds them correctly on Ubuntu > as well as Windows. Is this another issue related to openSUSE 11.2? > > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > Thanks > Dave > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > which version of SUSE are you using. There is a problem with 11.2 that > > causes rxtx to fail. > > > > One solution is to compile the libs so that they DO NOT use file locking. > > > > Another is to allow var/lock to be world read/writable (I've never tried > > this solution) > > > > Thew changes are: > > serial devices are now owned by root with a group of dialout > > var/lock is now owned by root with a group of root > > > > previously: > > > > serial devices were root:uucp > > var/lock was root:uucp > > > > > > I did find a bugzilla entry on this ages ago: > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > Andy > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > Daves TechShop wrote: > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app has > > > access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0). > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > needed > > > to be using the Sun jre. > > > > > > When I use update-alternatives --config java, there are 3 alternatives > > which > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > completely different messages, which I will share below. > > > > > > Any help is appreciated. > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > ----------------------------------------------- > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > details:Permission denied > > > check_lock_status: No permission to create lock file. > > > please see: How can I use Lock Files with rxtx? in INSTALL[/CODE]There is > > no > > > "INSTALL" file. However, I know the solution is supposed to be adding my > > > user to group uucp. I have done that. > > > > > > cat /etc/group > > > uucp:x:14:dave > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > ----------------------------------------------- > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I have > > a > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > total 1244 > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > dmesg > > > ... > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > address > > > 2 > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > idProduct=ea60 > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > SerialNumber=3 > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > [ 661.726356] USB Serial support registered for generic > > > [ 661.726488] usbcore: registered new interface driver usbserial_generic > > > [ 661.726508] usbserial: USB Serial Driver core > > > [ 661.735335] USB Serial support registered for cp210x > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd and > > > address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > driver > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From davestechshop at gmail.com Mon May 10 18:11:25 2010 From: davestechshop at gmail.com (Dave) Date: Mon, 10 May 2010 20:11:25 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511003757.68faa2e1@workstation.site> References: <20100510220708.67546e6f@workstation.site> <20100511003757.68faa2e1@workstation.site> Message-ID: Andy, Thank you very much for that info. Please do directly send me your document for the installation of the miniVNA. I would like to provide an update on my progress. After (temporarily) resolving the /dev/tty issue, I encountered this error: JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 ) # Problematic frame: # C [librxtxSerial.so+0x6462] read_byte_array+0x52 I got the same error with OpenJDK too. That led me to this: https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635 Upgrading to rxtx 2.2pre2 solved it for me too -- running Ubuntu 9.10 > (karmic) 64-bit. The download link is > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip. I used that new librxtxSerial.so file and the crash was resolved, but I do not receive any serial data. There are no more errors. I do get the expected warning: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 I'm guess that warning is not a problem. The app does work under Windows with rxtxSerial.dll. But in Linux, I get the same problems in openSUSE and Ubuntu now and one machine runs Sun Java, the other OpenJDK. Both have the same symptom - no error message but serial data is not received. I'm kinda wishing for my prior problem because at least that one gave an error message. ;) Dave On Mon, May 10, 2010 at 7:37 PM, Andy Eskelson wrote: > Dave, > I see you have found the chmod 666 on the serial ports. That's a > difference between Ubuntu and SUSE. I suspect that Ubuntu has a udev rule > that sets things up in that manner. > > It's easy enough to set up a rule on SUSE. > > Udev rules live in /etc/udev/rules.d/ > > if you ls that directory you will see things like 40-alsa.rules, > 60-pcmcia.rules and so on. > > The number is the priority, lower numbers over-ride the higher numbers. > The rules are simple text files. > > you need to do this as root: > > cd into /ect/udev/rules.d > touch 10-local.rules > > then edit 10-local.rules > > add the following > (edit the comments to taste) > > > > # > # udev rules for local use > # Main use is to allow access to the serial port hardware by users > # Found this to be necessary for WxToImg to control the receiver > # > # This rule sets the permissions of any ttyUSB device, i.e. ttyUSB0, > ttyUSB1 > # To 666 > # > KERNEL=="ttyUSB*", MODE="0666" > > > Then any usb port will get the full permissions. > > There is a very good document regarding udev rules here: > > http://www.reactivated.net/writing_udev_rules.html > > > > The bit about serial devices owned by root with a group of dialout, and > var/lock owned by root with a group of root, is the change to the owner > and permissions. > > In Linux a file or directory has an owner, and a group. This gives access > to the owner (obviously) and also gives access to anyone in group" If > you look at the various settings for your linux users you will find that > users can "belong" to a number of groups. > > previously > serial devices were root:uucp > var/lock was root:uucp > > So when a new serial port popped up into the list, it belonged to group > uucp > > As var/lock also has a group of uucp, the lock file could be created > without any problems. > > The change causes serial devices to be root:dialout > and var/lock as root:root > > Effectively this prevents anything other than root creating a lock file. > Not too helpful really. > > If this is a bit double dutch, give me a mail off list and I'll send you > a document that I produced for the installation of the miniVNA network > analyser group, which uses rxtx and is where I came across the SUSE > issue. It's got a more detailed guide in it. > > > > > Andy > > > > > On Mon, 10 May 2010 17:49:48 -0400 > Dave wrote: > > > Andy, > > That's a great help. Thank you. Yes, I'm using openSUSE 11.2. After > reading > > your reply, I took the easy solution and made /var/lock world > read/writable. > > That solved the error "No permission to create lock file". > > > > My java app starts up correctly now. However, it doesn't find the serial > > port. I can't understand why because dmesg shows lines that indicate all > is > > well: > > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > > and address 2 > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > ls /dev/tty* also shows ttyUSB0. > > But my app doesn't find any serial ports. It finds them correctly on > Ubuntu > > as well as Windows. Is this another issue related to openSUSE 11.2? > > > > I didn't understand this part of your message: > > > > serial devices are now owned by root with a group of dialout > > > > var/lock is now owned by root with a group of root > > > > > > How do I change permissions on /dev/ttyUSB0 (if that is required)? > > > > Thanks > > Dave > > > > On Mon, May 10, 2010 at 5:07 PM, Andy Eskelson wrote: > > > > > which version of SUSE are you using. There is a problem with 11.2 that > > > causes rxtx to fail. > > > > > > One solution is to compile the libs so that they DO NOT use file > locking. > > > > > > Another is to allow var/lock to be world read/writable (I've never > tried > > > this solution) > > > > > > Thew changes are: > > > serial devices are now owned by root with a group of dialout > > > var/lock is now owned by root with a group of root > > > > > > previously: > > > > > > serial devices were root:uucp > > > var/lock was root:uucp > > > > > > > > > I did find a bugzilla entry on this ages ago: > > > https://bugzilla.novell.com/show_bug.cgi?id=552095 > > > > > > > > > Andy > > > > > > > > > > > > > > > > > > On Mon, 10 May 2010 16:32:27 -0400 > > > Daves TechShop wrote: > > > > > > > I'm trying to set rxtxSerial to work on openSUSE so that a Java app > has > > > > access to a serial port (via SiLabs CP210x driver, port > /dev/ttyUSB0). > > > > > > > > After a lot of trouble shooting I arrived at the possibility that I > > > needed > > > > to be using the Sun jre. > > > > > > > > When I use update-alternatives --config java, there are 3 > alternatives > > > which > > > > provide `java'. I have now tried openJDK and Sun. Both fail but with > > > > completely different messages, which I will share below. > > > > > > > > Any help is appreciated. > > > > > > > > /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java > > > > ----------------------------------------------- > > > > [CODE]check_group_uucp(): error testing lock file creation Error > > > > details:Permission denied > > > > check_lock_status: No permission to create lock file. > > > > please see: How can I use Lock Files with rxtx? in > INSTALL[/CODE]There is > > > no > > > > "INSTALL" file. However, I know the solution is supposed to be adding > my > > > > user to group uucp. I have done that. > > > > > > > > cat /etc/group > > > > uucp:x:14:dave > > > > > > > > > > > > /usr/lib64/jvm/jre-1.6.0-sun/bin/java > > > > ----------------------------------------------- > > > > [CODE]ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in > > > > java.library.path thrown while loading gnu.io.RXTXCommDriver[/CODE]I > have > > > a > > > > link pointing to the gnu.io.RXTXCommDriver. It looks correct to me: > > > > ls -la /usr/lib64/jvm/jre/lib/ext/ > > > > total 1244 > > > > drwxr-xr-x 2 root root 4096 2010-05-10 12:02 . > > > > drwxr-xr-x 19 root root 4096 2009-12-06 11:49 .. > > > > -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar > > > > -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar > > > > -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index > > > > lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> > RXTXcomm.jar > > > > -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar > > > > -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar > > > > > > > > copy RXTXcomm.jar to [JDK-directory]/jre/lib/ext/ (done) > > > > copy librxtxSerial.so to /usr/lib64 (done) > > > > > > > > > > > > dmesg > > > > ... > > > > [ 661.208095] usb 4-1: new full speed USB device using uhci_hcd and > > > address > > > > 2 > > > > [ 661.353400] usb 4-1: New USB device found, idVendor=10c4, > > > idProduct=ea60 > > > > [ 661.353416] usb 4-1: New USB device strings: Mfr=1, Product=2, > > > > SerialNumber=3 > > > > [ 661.353431] usb 4-1: Product: CP2103 USB to UART Bridge Controller > > > > [ 661.353443] usb 4-1: Manufacturer: Silicon Labs > > > > [ 661.353453] usb 4-1: SerialNumber: 0001 > > > > [ 661.353679] usb 4-1: configuration #1 chosen from 1 choice > > > > [ 661.726229] usbcore: registered new interface driver usbserial > > > > [ 661.726356] USB Serial support registered for generic > > > > [ 661.726488] usbcore: registered new interface driver > usbserial_generic > > > > [ 661.726508] usbserial: USB Serial Driver core > > > > [ 661.735335] USB Serial support registered for cp210x > > > > [ 661.735386] cp210x 4-1:1.0: cp210x converter detected > > > > [ 661.837085] usb 4-1: reset full speed USB device using uhci_hcd > and > > > > address 2 > > > > [ 661.968782] usb 4-1: cp210x converter now attached to ttyUSB0 > > > > [ 661.969417] usbcore: registered new interface driver cp210x > > > > [ 661.969432] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor > > > driver > > > _______________________________________________ > > > 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: From Steffen.DETTMER at ingenico.com Tue May 11 03:43:51 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 11 May 2010 11:43:51 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> Message-ID: <20100511094351.GJ11487@elberon.bln.de.ingenico.com> * Dave wrote on Mon, May 10, 2010 at 17:49 -0400: > I didn't understand this part of your message: > > serial devices are now owned by root with a group of dialout > var/lock is now owned by root with a group of root > > How do I change permissions on /dev/ttyUSB0 (if that is required)? The users trusted to access /dev/ttyUSB0 should be member of the group dialout (can also be group uucp or something else on other systems). Permissions should be 0660 but not 0666! BTW, I think this is to be configured in `/etc/udev/rules.d/50-udev-default.rules'. No, I don't think that any permission change is required. With 0666 or a+rw permissions, EVERY programm, tool, user, hacker, virus and worm on your server can access your serial ports, even if launched via cron as `nobody', `nobody' could create lock files to DoS group dialout users and it can harm your baby. oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://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. P Please consider the environment before printing this e-mail From davestechshop at gmail.com Tue May 11 10:23:51 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:23:51 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: <20100511151525.GA5356@elberon.bln.de.ingenico.com> References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: Thanks to Andy and Steffen for the help so far. Here's the progress I have made so far. My java app reports: 05/11 11:45:40.202 Started 05/11 11:45:40.216 Operating system: Linux 05/11 11:45:40.336 Serial port list ok 05/11 11:45:40.379 Connecting to serial port /dev/ttyUSB0 05/11 11:45:40.390 Listening to serial stream 05/11 11:45:40.392 Connected to port /dev/ttyUSB0 05/11 11:45:40.393 All initialization complete 05/11 11:45:45.430 Serial port /dev/ttyUSB0 closed 05/11 11:45:45.431 Serial port /dev/ttyUSB0 not available. Retrying connection every 5s. The app is not closing the serial port. And the serial port doesn't seem to close under Windows (ie, the app works). strace shows this (and it gives no other output related to this issue afaik): Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File exists At the first moment the java app starts up, it reports that it is listening on the serial port. At the moment the "Error: creating lock file" message appears, the app's status changes to "Serial port /dev/ttyUSB0 not available." I don't think the problem is actually related to the lock file, however. I think that's an after-effect. The serial port is lost, and then the app tries to reconnect after 5 seconds and it discovers the prior lock file. The lock file is actually created correctly when the app first starts, so permissions, etc. are OK. Testing separately, but on the same computer, minicom works and will continuously receive data via the serial port without the port closing. Regards, Dave On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < Steffen.DETTMER at ingenico.com> wrote: > (you mailed me PM, not to the list) > > * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: > > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm > > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu > > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. > > But the java app (which works on Windows) receives nothing and gives > > no error message. Do you have a recommendation on how to > > test/troubleshoot this? Thanks. > > I'm afraid the Windows implementation and the linux > implementation are very different. When I worked with the C side > of rxtx some years ago (2006 IIRC), there were many issues but at > this time the mailinglist was almost unused. Since then, many > things had been improved so my knowledge about the internals is > completely outdated, I guess. > > Anyway, I would start with `strace', best redirected to a file, > because surely really a lot, I mean HEAAAAAAAAAAAPS of output > will be generated. It should show the system calls to open, read > and write and I think first I'd try to verify if it hangs in a > call and if so, in which one and why. Probably some > threshold/timeout/whatever parameter combination is set wrongly > or flow control enabled but not supported or alike. > > You may also try if it makes a difference if you leave minicom > with ALT-Q and instantly run your application afterwards. > > oki, > > Steffen > > > > > About Ingenico: Ingenico is a leading provider of payment solutions, with > over 15 million terminals deployed in more than 125 countries. Its 2,850 > employees worldwide support retailers, banks and service providers to > optimize and secure their electronic payments solutions, develop their offer > of services and increase their point of sales revenue. More information on > http://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. > P Please consider the environment before printing this e-mail > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Tue May 11 10:45:05 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 12:45:05 -0400 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In both those cases Windows reports an exception.? The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? From mariusz.dec at gmail.com Tue May 11 10:47:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 18:47:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > Thanks to Andy and Steffen for the help so far. > > Here's the progress I have made so far. My java app reports: > > I don't think the problem is actually related to the lock file, however. I > think that's an after-effect. The serial port is lost, and then the app > tries to reconnect after 5 seconds and it discovers the prior lock file. > > The lock file is actually created correctly when the app first starts, so > permissions, etc. are OK. > > Testing separately, but on the same computer, minicom works and will > continuously receive data via the serial port without the port closing. > > Regards, > Dave > > Hi Dave Now is my order to help you :) - I am RXTX close() guru I have spend a lot of time and this is done - I have started from Windows - works without proper close and have had to finish in Linux and Mac where proper close is NECESSARY. So look for thread in November "RXTX close() problem solved". Read carefully example attached here and follow CONFIGURATION ideas described in code and operations order while opening and closing ports. Regards Mariusz > > > On Tue, May 11, 2010 at 11:15 AM, Steffen DETTMER < > Steffen.DETTMER at ingenico.com> wrote: > >> (you mailed me PM, not to the list) >> >> * Dave wrote on Tue, May 11, 2010 at 09:40 -0400: >> > BTW, I still cannot get rxtxSerial to work on Linux. The java app I'm >> > using works on WIndows, but it fails on openSUSE (OpenJDK) and Ubuntu >> > (Sun java). Minicom will connect to /dev/ttyUSB0 and receive data. >> > But the java app (which works on Windows) receives nothing and gives >> > no error message. Do you have a recommendation on how to >> > test/troubleshoot this? Thanks. >> >> I'm afraid the Windows implementation and the linux >> implementation are very different. When I worked with the C side >> of rxtx some years ago (2006 IIRC), there were many issues but at >> this time the mailinglist was almost unused. Since then, many >> things had been improved so my knowledge about the internals is >> completely outdated, I guess. >> >> Anyway, I would start with `strace', best redirected to a file, >> because surely really a lot, I mean HEAAAAAAAAAAAPS of output >> will be generated. It should show the system calls to open, read >> and write and I think first I'd try to verify if it hangs in a >> call and if so, in which one and why. Probably some >> threshold/timeout/whatever parameter combination is set wrongly >> or flow control enabled but not supported or alike. >> >> You may also try if it makes a difference if you leave minicom >> with ALT-Q and instantly run your application afterwards. >> >> >> oki, >> >> Steffen >> >> >> >> >> About Ingenico: Ingenico is a leading provider of payment solutions, with >> over 15 million terminals deployed in more than 125 countries. Its 2,850 >> employees worldwide support retailers, banks and service providers to >> optimize and secure their electronic payments solutions, develop their offer >> of services and increase their point of sales revenue. More information on >> http://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. >> P Please consider the environment before printing this e-mail >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.zip Type: application/zip Size: 2419 bytes Desc: not available URL: From davestechshop at gmail.com Tue May 11 11:43:15 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 11 May 2010 13:43:15 -0400 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > > > 2010/5/11 Dave > > Thanks to Andy and Steffen for the help so far. >> >> > Here's the progress I have made so far. My java app reports: >> >> I don't think the problem is actually related to the lock file, however. I >> think that's an after-effect. The serial port is lost, and then the app >> tries to reconnect after 5 seconds and it discovers the prior lock file. >> >> The lock file is actually created correctly when the app first starts, so >> permissions, etc. are OK. >> >> Testing separately, but on the same computer, minicom works and will >> continuously receive data via the serial port without the port closing. >> >> Regards, >> Dave >> >> > Hi Dave > Now is my order to help you :) - > I am RXTX close() guru > > I have spend a lot of time and this is done - I have started from Windows - > works without proper close and have had to finish in Linux and Mac where > proper close is NECESSARY. > > So look for thread in November "RXTX close() problem solved". > Read carefully example attached here and follow CONFIGURATION ideas > described in code and operations order while opening and closing ports. > > Regards > Mariusz > > Thank you. For reference, I found that thread at this link: http://mailman.qbang.org/pipermail/rxtx/2009-November/6248696.html I will read that, but... I get the feeling it is going to take me days to read and understand *all* this... (I'm not a developer) Is this the critical configuration item? > commPort.enableReceiveTimeout(10); > Reading your java code is very helpful (even to someone who is not a java developer). How would I run your code? I just want to listen on a serial port and display incoming characters in a text box (e.g., similar to SerialWatcher freeware). I'll run it on Linux first. I see that I will uncomment the Linux portName in main(). But I want to read, not write the serial port. And I would need a way to keep the app open while I test for a few minutes by sending it data and checking that it receives correctly. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 11:56:24 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 19:56:24 +0200 Subject: [Rxtx] can't get rxtxSerial working - newbie lost In-Reply-To: References: <20100510220708.67546e6f@workstation.site> <20100511094351.GJ11487@elberon.bln.de.ingenico.com> <20100511151525.GA5356@elberon.bln.de.ingenico.com> Message-ID: 2010/5/11 Dave > On Tue, May 11, 2010 at 12:47 PM, Mariusz Dec wrote: > >> > > I will read that, but... I get the feeling it is going to take me days to > read and understand *all* this... (I'm not a developer) > > Is this the critical configuration item? > >> commPort.enableReceiveTimeout(10); >> > YES, YES YES. > Reading your java code is very helpful (even to someone who is not a java > developer). How would I run your code? I just want to listen on a serial > port and display incoming characters in a text box (e.g., similar to > SerialWatcher freeware). > Simply Install NetBeans on Linux and use this code. Printouts are on console. If you do a loop - wire between 2 and 3 on DB9, you will see transmission. > I'll run it on Linux first. I see that I will uncomment the Linux portName > in main(). > Yes, and write down there your port name. > But I want to read, not write the serial port. And I would need a way to > keep the app open while I test for a few minutes by sending it data and > checking that it receives correctly. > You have to write a piece of code using this example. You may remove software loop in main() as well and connect your device to 2 on DB9 and you will see only incoming transmission. Set Speed etc. And remember that proper close needs correct operations order while close(). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 12:54:39 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 11 May 2010 20:54:39 +0200 Subject: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll - crash In-Reply-To: References: Message-ID: 2010/5/11 Dave > I've been testing my java app under Linux. While I'm waiting to figure > out what to test next, I start doing separate testing on Windows. > > Serial transmission basically works on Windows, so now I'm testing > what happens when I unplug the cable or turn the instrument off. In > Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz > both those cases Windows reports an exception. The information shown > is: > Error Signature > AppName: javaw.exe > AppVer: 6.0.170.4 > ModName: rxtxserial.dll > Offset: 0000c455 > > Any ideas? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Tue May 11 22:59:32 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 06:59:32 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A__javaw=2Eexe_has_encountered_a_pro?= =?iso-8859-1?q?blem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBC@lune.ses-esl.com> Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue May 11 23:47:38 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 07:47:38 +0200 Subject: [Rxtx] RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: 2010/5/12 Luc PEUVRIER > Hi, > > Having this problems on windows X3 pack 3 using usb to serial adapter with > possibly a "bad" driver, We asked in mailing list for a modification of > RXTX, that is: system errors should not be displayed in console, but should > throws an IOException whith message set to system error message. > > Luc > > Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz > > ------------------------------ > *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec > *Date:* mar. 11/05/2010 20:54 > *?:* Dave > *Cc:* rxtx at qbang.org > *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll > -crash > > > > 2010/5/11 Dave > >> I've been testing my java app under Linux. While I'm waiting to figure >> out what to test next, I start doing separate testing on Windows. >> >> Serial transmission basically works on Windows, so now I'm testing >> what happens when I unplug the cable or turn the instrument off. In >> > > Hi, > Unplugging USB cable gives error: > > Error 0x5 at ../src/termios.c(892): Access denied. > > Good Windows VCP driver not crashes JVM. You may reconnect dongle and > reopen port WITHOUT exiting application. > > Many times tested in my application on Java JVM from xxxxx_15 to xxxx > _18, XP/Vista/W7. > > RXTX pre2.2 > > So.... > > Mariusz > > > > > >> both those cases Windows reports an exception. The information shown >> is: >> Error Signature >> AppName: javaw.exe >> AppVer: 6.0.170.4 >> ModName: rxtxserial.dll >> Offset: 0000c455 >> >> Any ideas? >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.peuvrier at ses-esl.com Wed May 12 00:35:02 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Wed, 12 May 2010 08:35:02 +0200 Subject: [Rxtx] =?iso-8859-1?q?RE=A0=3A_RE_=3A__javaw=2Eexe_has_encountere?= =?iso-8859-1?q?d_a_problem_in_rxtxserial=2Edll_-crash?= References: Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F027DABBE@lune.ses-esl.com> Hi Mariusz, I think understood your point of view. I have some proposals according to this: - the throwed IOException should kept RXTX in stable state (no automatic close) to be able to call again i/o methods to recorver after a deconnection/reconnection. - may be have a RXTX parameters to switch on/off system error throws IOException - extends IOEXception with HwDisconnectedException - I also thing about a method to obtains the state, may be a listener for state change, and/or notify system errors. There is an other "terrible" case we encountered with ethernet/serial adapter ( http://www.axel.com/uk2/ and http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device is a pseudo tty and read timeout configuration have no effect due to the axel tty deamon implementation. We changed the code to manage read waiting at application level. Regards Luc ________________________________ De: Mariusz Dec [mailto:mariusz.dec at gmail.com] Date: mer. 12/05/2010 07:47 ?: Luc PEUVRIER Cc: Dave; rxtx at qbang.org Objet : Re: RE : [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/12 Luc PEUVRIER Hi, Having this problems on windows X3 pack 3 using usb to serial adapter with possibly a "bad" driver, We asked in mailing list for a modification of RXTX, that is: system errors should not be displayed in console, but should throws an IOException whith message set to system error message. Luc Hi Luc, Yoy are right, it should be. But this is not easy to do it exactly from the RXTX-Java side. I have written few JNI interfaces in the past, but serial ports handling is quite complicated and differs between systems. I am feeling NOT so strong to do changes in this part of the RXTX :(. I think that Core problem came from the past - there were NO WAY to remove UART device from the system's hardware. Situaton has changed when USB VCP has arrived. But systems in general aren't ready to serve dissapointed UART... Only hope in good VCP drivers - I have found one HW & SW set which works very good in all Windows from XP. The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes removing USB pid file is needed. (we are talking about unplugging USB - VCP). Unfortunatelly changing VCP HW&SW isn't possible in many cases. BTW: I have chosed FTDI HW&SW. Regards Mariusz ________________________________ De: rxtx-bounces at qbang.org de la part de Mariusz Dec Date: mar. 11/05/2010 20:54 ?: Dave Cc: rxtx at qbang.org Objet : Re: [Rxtx] javaw.exe has encountered a problem in rxtxserial.dll -crash 2010/5/11 Dave I've been testing my java app under Linux. While I'm waiting to figure out what to test next, I start doing separate testing on Windows. Serial transmission basically works on Windows, so now I'm testing what happens when I unplug the cable or turn the instrument off. In Hi, Unplugging USB cable gives error: Error 0x5 at ../src/termios.c(892): Access denied. Good Windows VCP driver not crashes JVM. You may reconnect dongle and reopen port WITHOUT exiting application. Many times tested in my application on Java JVM from xxxxx_15 to xxxx _18, XP/Vista/W7. RXTX pre2.2 So.... Mariusz both those cases Windows reports an exception. The information shown is: Error Signature AppName: javaw.exe AppVer: 6.0.170.4 ModName: rxtxserial.dll Offset: 0000c455 Any ideas? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Wed May 12 01:10:29 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Wed, 12 May 2010 09:10:29 +0200 Subject: [Rxtx] RE : RE : javaw.exe has encountered a problem in rxtxserial.dll -crash Message-ID: Hi Luc, I am not a developer of the RXTX. I had to solve problems with my app and after success I am sharing my knowledge about known for me elements of the RXTX... Throwing IOException is quite simple, but problem (with crash) what I "feel" is OUTSIDE RXTX native part and OUTSIDE RXTX Java part as well - this is why I think that proper reactions for disconnecting each of USB dongle as a big challenge. Please note that my app with RXTX 2.2 pre DOESN"T crash jvm NOWHERE where I have checked disconneting... Your ideas and steps to solve problems are very good, but before my needs to solve it for each USB device, I have to do other things to have money for beer :). RXTX is a in fact single person's project - Trent Jarvi... big job, but... In the years of the RXTX life, OS-system has changed in many manners... Looking from one side common c-source with conditionals for Linux, Mac, Solaris etc. is very elegant, but from other side - reverse engineering in this case is very difficult - nobody knows all systems very good. Maybe separate project for most popular platforms - Windows Linux and Macintosh only? Or separate c-sources for each - RXTXW/RXTXL/RXTXM? What about ARM's, pockets etc. There is a joke in Poland - if something is for everything, it means that is for nothing :). I don't know... Regards Mariusz. 2010/5/12 Luc PEUVRIER > Hi Mariusz, > > I think understood your point of view. > I have some proposals according to this: > - the throwed IOException should kept RXTX in stable state (no automatic > close) to be able to call again i/o methods to recorver after a > deconnection/reconnection. > - may be have a RXTX parameters to switch on/off system error throws > IOException > - extends IOEXception with HwDisconnectedException > - I also thing about a method to obtains the state, may be a listener for > state change, and/or notify system errors. > > There is an other "terrible" case we encountered with ethernet/serial > adapter ( http://www.axel.com/uk2/ and > http://www.moxa.com/product/NPort_5110.htm ) used in sco unix. The device > is a pseudo tty and read timeout configuration have no effect due to the > axel tty deamon implementation. We changed the code to manage read waiting > at application level. > > Regards > Luc > > > ------------------------------ > *De:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Date:* mer. 12/05/2010 07:47 > *?:* Luc PEUVRIER > *Cc:* Dave; rxtx at qbang.org > *Objet :* Re: RE : [Rxtx] javaw.exe has encountered a problem in > rxtxserial.dll -crash > > > > 2010/5/12 Luc PEUVRIER > >> Hi, >> >> Having this problems on windows X3 pack 3 using usb to serial adapter with >> possibly a "bad" driver, We asked in mailing list for a modification of >> RXTX, that is: system errors should not be displayed in console, but should >> throws an IOException whith message set to system error message. >> >> Luc >> >> > Hi Luc, > Yoy are right, it should be. > But this is not easy to do it exactly from the RXTX-Java side. > > I have written few JNI interfaces in the past, but serial ports handling is > quite complicated and differs between systems. I am feeling NOT so strong to > do changes in this part of the RXTX :(. > > I think that Core problem came from the past - there were NO WAY to remove > UART device from the system's hardware. Situaton has changed when USB VCP > has arrived. > But systems in general aren't ready to serve dissapointed UART... > > Only hope in good VCP drivers - I have found one HW & SW set which works > very good in all Windows from XP. > > The same set HW&SW in Linux and Mac DOESN'T crash JVM but sometimes > removing USB pid file is needed. (we are talking about unplugging USB - > VCP). > Unfortunatelly changing VCP HW&SW isn't possible in many cases. > > BTW: I have chosed FTDI HW&SW. > > Regards > Mariusz > > > > > >> >> ------------------------------ >> *De:* rxtx-bounces at qbang.org de la part de Mariusz Dec >> *Date:* mar. 11/05/2010 20:54 >> *?:* Dave >> *Cc:* rxtx at qbang.org >> *Objet :* Re: [Rxtx] javaw.exe has encountered a problem in >> rxtxserial.dll -crash >> >> >> >> 2010/5/11 Dave >> >>> I've been testing my java app under Linux. While I'm waiting to figure >>> out what to test next, I start doing separate testing on Windows. >>> >>> Serial transmission basically works on Windows, so now I'm testing >>> what happens when I unplug the cable or turn the instrument off. In >>> >> >> Hi, >> Unplugging USB cable gives error: >> >> Error 0x5 at ../src/termios.c(892): Access denied. >> >> Good Windows VCP driver not crashes JVM. You may reconnect dongle and >> reopen port WITHOUT exiting application. >> >> Many times tested in my application on Java JVM from xxxxx_15 to xxxx >> _18, XP/Vista/W7. >> >> RXTX pre2.2 >> >> So.... >> >> Mariusz >> >> >> >> >> >>> both those cases Windows reports an exception. The information shown >>> is: >>> Error Signature >>> AppName: javaw.exe >>> AppVer: 6.0.170.4 >>> ModName: rxtxserial.dll >>> Offset: 0000c455 >>> >>> Any ideas? >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 07:05:28 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 15:05:28 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: <201005121505.29039.karl.weber99@gmx.net> Hi, I have analysed the behaviour of RXTX a little further. There are certain timing problems between RXTX and my kernel (driver). I don't know how to fix them, but in the following I will present my analysis, since it might help to improve RXTX. Well, maybe at least someone can tell me what is going on... My environment: openSUSE 11.1 out of the box, one Bluetooth dongle. The timing problems can only be observed with bluetooth. USB is working properly. In the following three experiments. (1) Experiment: ========================================================================== I run the command java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); a couple of times in a for-loop and printed the devices found. Everything in the main-method, no threading issues in the java program. Sometimes the bluetooth port /dev/rfcomm0 is found, sometimes not. The library was loaded before, to remove the loading and initialisation time from the measurement. Loading and initialisation time is somewhere between 3 sec and more than 10 sec.... :-( Iteration count of for-loop: 20. 11 times the bluetooth port has been found, 9 times it has not been found. The time is measured in msec for the one statement given above: ? 0, start listing ports... 927, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 248, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 380, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?35, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 150, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?33, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 148, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 714, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 250, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 557, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?30, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 910, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 265, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 687, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 149, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?32, ... list created /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... 126, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- ? 0, start listing ports... ?31, ... list created /dev/rfcomm0 - Serial /dev/ttyUSB0 - Serial /dev/ttyS4 - Serial /dev/ttyS0 - Serial ---------------- DONE. (2) Experiment: ========================================================================== The following method was run in a for-loop a couple of times. Again everything in the main method, no threading issues in the java program. The method contains two statements Thread.sleep(). If the time is significantly smaller (in either case!), the following call to open() will throw a no such port exception or a port in use exception quite often (but not always) -- although the statement isCurrentlyOwned() returns false in any case. The call to time prints the time. Again, there is no problem with USB, only with bluetooth. private static void getSelectedPort(String portName) { ? ? ????CommPortIdentifier portIdentifier; ? ? ????CommPort commPort; ? ? ????start = System.currentTimeMillis(); ? ? ????try { ? ? ????????????time("start"); ????????????????????????portIdentifier = CommPortIdentifier.getPortIdentifier(portName); ????????????????????????time("got port identifier"); ????????????????????????if (portIdentifier.isCurrentlyOwned()) { ????????????????????????????????System.out.println("Port is currently in use"); ????????????????????????} else { ????????????????????????????????time("start to sleep..."); ????????????????????????????????Thread.sleep(100); ????????????????????????????????time("try to open port..."); ????????????????????????????????commPort = portIdentifier.open(DiscoverCommPorts.class.getName(), 2000); ????????????????????????????????time("... port is open"); ????????????????????????????????if (commPort instanceof SerialPort) { ????????????????????????????????????????SerialPort sp = (SerialPort)commPort; ????????????????????????????????????????time("try to close port..."); ????????????????????????????????????????sp.close(); ????????????????????????????????????????time("... port is closed"); ????????????????????????????????????????Thread.sleep(1000); ????????????????????????????????} ????????????????????????} ????????????????} catch (NoSuchPortException e) { ????????????????????????System.out.println("EX NoSuchPortException ?: " + e.getLocalizedMessage()); ????????????????} catch (PortInUseException e) { ????????????????????????System.out.println("EX PortInUseException ? : " + e.getLocalizedMessage()); ????????????????} catch (InterruptedException e) { ????????????????????????System.out.println("EX InterruptedException : " + e.getLocalizedMessage()); ????????????????} ? ? ???? ????????} Here the measurement, which may be quite interesting. With USB, all measured times are of order 1 msec. With bluetooth they are a factor of 1000 higher. ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1166, ... port is open 1166, try to close port... 1170, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 349, ... port is open 350, try to close port... 355, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1386, ... port is open 1387, try to close port... 1389, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 533, ... port is open 534, try to close port... 535, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 100, try to open port... 1467, ... port is open 1467, try to close port... 1472, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 569, ... port is open 569, try to close port... 572, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... 101, try to open port... 1422, ... port is open 1422, try to close port... 1424, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 564, ... port is open 564, try to close port... 568, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 1426, ... port is open 1427, try to close port... 1429, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... 101, try to open port... 536, ... port is open 536, try to close port... 539, ... port is closed DONE. (3) Experiment ========================================================================== Same as (2), but with Tread.sleep(50) before open, instead of Thread.sleep(100). Look at the end of the following output. ? 0, start ? 1, got port identifier ? 1, start to sleep... ?51, try to open port... 1552, ... port is open 1552, try to close port... 1557, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 249, ... port is open 250, try to close port... 252, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1492, ... port is open 1492, try to close port... 1496, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 289, ... port is open 289, try to close port... 292, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... 1455, ... port is open 1455, try to close port... 1456, ... port is closed ? 0, start ? 0, got port identifier ? 1, start to sleep... ?51, try to open port... 332, ... port is open 333, try to close port... 336, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... 1411, ... port is open 1412, try to close port... 1415, ... port is closed ? 0, start ? 0, got port identifier ? 0, start to sleep... ?51, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists ?50, try to open port... EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java ? 0, start ? 0, got port identifier ? 0, start to sleep... ?50, try to open port... RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..rfcomm0: File exists EX PortInUseException ? : ?as PID = ?12427 Program = java as PID = ?12427 Program = java as PID = ?12427 Program = java DONE. From jdp at syntelos.org Wed May 12 09:58:16 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 12 May 2010 11:58:16 -0400 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121505.29039.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: > Hi, > > I have analysed the behaviour of RXTX a little further. There are certain > timing problems between RXTX and my kernel (driver). I don't know how to > fix > them, but in the following I will present my analysis, since it might help > to > improve RXTX. Well, maybe at least someone can tell me what is going on... > > > Hi Karl, Data like this should be compared to data from a C language implementation in order to define a point of reference above the kernel and under the jvm. Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Wed May 12 10:40:08 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 12 May 2010 18:40:08 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> Message-ID: <201005121840.08572.karl.weber99@gmx.net> Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > Hi Karl, > > Data like this should be compared to data from a C language implementation > in order to define a point of reference above the kernel and under the jvm. > > Cheers, > John Yea, unfortunately, writing a corresponding test program in c is a little out of my line... However, if someone could provide the source of a working example, I could try to provide those numbers as reference. /Karl From mariusz.dec at gmail.com Thu May 13 04:08:17 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 13 May 2010 12:08:17 +0200 Subject: [Rxtx] Rxtx timing problems with bluetooth on linux (was RXTX not working with bluetooth on linux) In-Reply-To: <201005121840.08572.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> <201005121505.29039.karl.weber99@gmx.net> <201005121840.08572.karl.weber99@gmx.net> Message-ID: 2010/5/12 Karl Weber > Am Mittwoch, 12. Mai 2010 17:58 schrieben Sie: > > Hi Karl, > > > > Data like this should be compared to data from a C language > implementation > > in order to define a point of reference above the kernel and under the > jvm. > > > > Cheers, > > John > > Yea, unfortunately, writing a corresponding test program in c is a little > out > of my line... However, if someone could provide the source of a working > example, I could try to provide those numbers as reference. > > Hi I think that problem isn't in Java and test program outside Java shows nothing more, OF COURSE if you see this device in native system without problems. List of the devices in the OS works very simillar to RXTX's methods to obtain devices list. Please note that in yor experiment (1) almost ever you have BT device found and next time not found. I think that while device closes themselves needs many time for this and therefore isn't visible on the Java's list. BT for Java is visible as a VCP device, not native USB and therefore dissapears while device is internal busy. This is the difference between native system and Java after JNI. Native system knows about activity on USB even if device finally will be visible as a VCP port and therefore registers BT device. Finally - If you don't see device in native system each time, should be clear that device works not enough fast for system identification as well. Regards Mariusz /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ra85551 at gmail.com Fri May 14 08:51:34 2010 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Fri, 14 May 2010 18:51:34 +0400 Subject: [Rxtx] problem with compiling RXTX for OpenWrt 10.03 host Message-ID: Hello, I try to compile RXTX for use on OpenWrt box. ./configure --host=mipsel-openwrt-linux --prefix=/home/pavel/rxtx2.2-bin make But I've been got a following error: mipsel-openwrt-linux-gcc -I/home/pavel/rxtx-2.2pre2 -Imipsel-openwrt-linux-gnu -I. -I/opt/java/include -I/opt/java/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/pavel/rxtx-2.2pre2/./src/RawImp.c -fPIC -DPIC -o /home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/.libs/RawImp.o /home/pavel/rxtx-2.2pre2/./src/RawImp.c:104:20: sys/io.h: No such file or directory libtool: link: `/home/pavel/rxtx-2.2pre2/mipsel-openwrt-linux-gnu/RawImp.lo' is not a valid libtool object I've found no better solution than comment out entire line 104 in src/RawImp.c 104c104 < //#include --- > #include After that compilation has been succeeded. But is this the best way to compile? -- Pavel Parkhomenko From davestechshop at gmail.com Fri May 14 13:08:58 2010 From: davestechshop at gmail.com (Dave) Date: Fri, 14 May 2010 15:08:58 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux Message-ID: Here is some non-technical feedback about rxtx on two platforms. (I'm not a developer.) We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, but it has one problem we can't overcome. Windows: -------------------- 2.2pre2 on Windows crashes when the connected device is turned off or unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. Linux: -------------------- The best way I can explain the 2.2.pre2 problem on Linux is to paste this: "Tell them the read on the inputstream doesn't block, and when you enable the receiveTimeout, it gets forgotten after the first bytes are received [and it cannot be re-asserted]." Workarounds: -------------------- A workaround for the problem is possible on Windows, but we haven't found one for Linux. Our code is doing something that is not done by the example code generous people on this list helped me with. Our code receives many serial input events over 24 hours without intentionally disconnecting. The receiveTimeout problem is only evident after the first data packet is complete and the connection remains open for some time. Furthermore, if the instrument is disconnected, our app needs to wait and reconnect when the instrument becomes available. rxtx 2.2pre2 will not do this (on Windows). However, 2.1.7 will handle the disconnect and recover. The biggest problem for us is 2.2pre2 on Linux because we haven't found any workaround yet. We can't go back to 2.1.7 on Linux either (because it apparently doesn't work). Wish I could say something that would be more meaningful to you guys (especially the devs), but I hope what I have said is of value to someone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sat May 15 00:52:11 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 15 May 2010 08:52:11 +0200 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: 2010/5/14 Dave > Here is some non-technical feedback about rxtx on two platforms. (I'm not a > developer.) > > We can't get 2.2pre2 to work reliably on Windows. It works better on Linux, > but it has one problem we can't overcome. > > Windows: > -------------------- > 2.2pre2 on Windows crashes when the connected device is turned off or > unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. > Hi Dave Sorry - I don't agree with above description - I have had more problems with 2.1.7... I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting USB dongle if I am using software construction shown in my previous examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. Everything is to safelly catch in Java and reconnect! There are several things more while working with system's suspend's as well. I have observed (mainly in W7) that small activity of the COM channel may results in VCP driver deactivation (or somethnig like that). Therefore I have prepared my external device to generate dummy data (SW software version) in declared time intervals. Problems has gone... In Vista there were enough to disable energy saving on USB ports in notebook - this problem wasn't observed on desktop. Regards Mariusz > Linux: > -------------------- > The best way I can explain the 2.2.pre2 problem on Linux is to paste this: > > "Tell them the read on the inputstream doesn't block, and when you enable > the receiveTimeout, it gets forgotten after the first bytes are received > [and it cannot be re-asserted]." > > Workarounds: > -------------------- > A workaround for the problem is possible on Windows, but we haven't found > one for Linux. > > Our code is doing something that is not done by the example code generous > people on this list helped me with. Our code receives many serial input > events over 24 hours without intentionally disconnecting. The receiveTimeout > problem is only evident after the first data packet is complete and the > connection remains open for some time. > > Furthermore, if the instrument is disconnected, our app needs to wait and > reconnect when the instrument becomes available. rxtx 2.2pre2 will not do > this (on Windows). However, 2.1.7 will handle the disconnect and recover. > > The biggest problem for us is 2.2pre2 on Linux because we haven't found any > workaround yet. We can't go back to 2.1.7 on Linux either (because it > apparently doesn't work). > > Wish I could say something that would be more meaningful to you guys > (especially the devs), but I hope what I have said is of value to someone. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Sat May 15 02:30:49 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 08:30:49 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 Message-ID: Hi, I just wanted to know why the parallel port dll for windows is missing in the pre2.2 binary package? Does anyone have it compiled and working? Thanks -- George H george.dma at gmail.com From george.dma at gmail.com Sat May 15 03:33:08 2010 From: george.dma at gmail.com (George H) Date: Sat, 15 May 2010 09:33:08 +0000 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 In-Reply-To: References: Message-ID: On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked?? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > From mariusz.dec at gmail.com Sat May 15 05:38:29 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 15 May 2010 13:38:29 +0200 Subject: [Rxtx] ParallelPort dll missing for windows in pre2.2 References: Message-ID: <57E4C18871C249EC82846512B38F121D@mdam2> Hi, I have just compiled it, but my RXTX 2.2 pre hasn't last CVS's. Do you have any FTP? Many mail relay servers blocks mails with dll's. Regards Mariusz ----- Original Message ----- From: "George H" To: "rxtx" Sent: Saturday, May 15, 2010 11:33 AM Subject: Re: [Rxtx] ParallelPort dll missing for windows in pre2.2 On Sat, May 15, 2010 at 9:29 AM, John Pritchard wrote: > Maybe check the symbol table to see if it's linked? Is there a loading > error on startup? (would be) Hi John, well I get an unsatisfied link exception when I try to connect to the parallel port. It says "no rxtxParallel in java.library.path" Obviously I have the rxtxSerial.dll file in the library path, but as I mentioned, there was no dll file for the parallel (there is for linux though). > > On Sat, May 15, 2010 at 4:30 AM, George H wrote: >> >> Hi, >> >> I just wanted to know why the parallel port dll for windows is missing >> in the pre2.2 binary package? Does anyone have it compiled and >> working? >> Thanks >> -- >> George H >> george.dma at gmail.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > http://www.google.com/profiles/john.douglas.pritchard > > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From davestechshop at gmail.com Sat May 15 15:04:02 2010 From: davestechshop at gmail.com (Dave) Date: Sat, 15 May 2010 17:04:02 -0400 Subject: [Rxtx] rxtx 2.1.7r2 vs 2.2pre2 on Windows and Linux In-Reply-To: References: Message-ID: Your example code was very, very helpful. However, the developer told me that your example code does not test the scenarios we are encountering. I'll see if I can get him to post a little more info. Sorry I don't have more to add at this time. Dave On Sat, May 15, 2010 at 2:52 AM, Mariusz Dec wrote: > > > 2010/5/14 Dave > > Here is some non-technical feedback about rxtx on two platforms. (I'm not a >> developer.) >> >> We can't get 2.2pre2 to work reliably on Windows. It works better on >> Linux, but it has one problem we can't overcome. >> >> Windows: >> -------------------- >> 2.2pre2 on Windows crashes when the connected device is turned off or >> unplugged. 2.1.7r2 doesn't exhibit this problem on Windows. >> > > Hi Dave > > Sorry - I don't agree with above description - I have had more problems > with 2.1.7... > > I have NO PROBLEMS on Windows XP/Vista/W7 with 2.2pre2 while disconnecting > USB dongle if I am using software construction shown in my previous > examples. In my opinion - THIS WAS A KEY, NO RXTX VERSION. > Everything is to safelly catch in Java and reconnect! > > There are several things more while working with system's suspend's as > well. > > I have observed (mainly in W7) that small activity of the COM channel may > results in VCP driver deactivation (or somethnig like that). > Therefore I have prepared my external device to generate dummy data (SW > software version) in declared time intervals. > Problems has gone... > In Vista there were enough to disable energy saving on USB ports in > notebook - this problem wasn't observed on desktop. > > > Regards > Mariusz > > >> Linux: >> -------------------- >> The best way I can explain the 2.2.pre2 problem on Linux is to paste this: >> >> "Tell them the read on the inputstream doesn't block, and when you enable >> the receiveTimeout, it gets forgotten after the first bytes are received >> [and it cannot be re-asserted]." >> >> Workarounds: >> -------------------- >> A workaround for the problem is possible on Windows, but we haven't found >> one for Linux. >> >> Our code is doing something that is not done by the example code generous >> people on this list helped me with. Our code receives many serial input >> events over 24 hours without intentionally disconnecting. The receiveTimeout >> problem is only evident after the first data packet is complete and the >> connection remains open for some time. >> >> Furthermore, if the instrument is disconnected, our app needs to wait and >> reconnect when the instrument becomes available. rxtx 2.2pre2 will not do >> this (on Windows). However, 2.1.7 will handle the disconnect and recover. >> >> The biggest problem for us is 2.2pre2 on Linux because we haven't found >> any workaround yet. We can't go back to 2.1.7 on Linux either (because it >> apparently doesn't work). >> >> Wish I could say something that would be more meaningful to you guys >> (especially the devs), but I hope what I have said is of value to someone. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon May 17 08:36:43 2010 From: george.dma at gmail.com (George H) Date: Mon, 17 May 2010 14:36:43 +0000 Subject: [Rxtx] Printing hangs when sending data to parallel port Message-ID: Hi, I am getting a really weird and annoying problem and I have exhausted all options. I am using rxtx pre2.2 on linux. I am connecting to a receipt printer on a parallel port (/dev/lp0) The receipt printer has a 4.0Kb data buffer Here's the problem. In my java program when I send it bytes (and I do a .flush() after each invocation of .write(byte[])) it prints the data but stops arbitrarily during the print process. I wait a bit... re-send the data to get printed. 1 out of 3 times it succeeds and prints everything. But with long data it has problems. Now here is the weird part. I create a text file with 7Kb of text data. I run the command "cat test.txt > /dev/lp0" and the printer prints everything in 1 go without any problems. So I don't know, I am thinking maybe this is a problem with rxtx ? maybe I need to set some parallel parameters? Or should I try reverting to the 2.1 version of rxtx if the parallel code is more reliable? Thanks for helping -- George H george.dma at gmail.com From george.dma at gmail.com Tue May 18 00:16:54 2010 From: george.dma at gmail.com (George H) Date: Tue, 18 May 2010 09:16:54 +0300 Subject: [Rxtx] Printing hangs when sending data to parallel port In-Reply-To: References: Message-ID: On Mon, May 17, 2010 at 5:36 PM, George H wrote: > Hi, > > I am getting a really weird and annoying problem and I have exhausted > all options. I am using rxtx pre2.2 on linux. > I am connecting to a receipt printer on a parallel port (/dev/lp0) The > receipt printer has a 4.0Kb data buffer > > Here's the problem. In my java program when I send it bytes (and I do > a .flush() after each invocation of .write(byte[])) it prints the data > but stops arbitrarily during the print process. I wait a bit... > re-send the data to get printed. 1 out of 3 times it succeeds and > prints everything. But with long data it has problems. > > Now here is the weird part. I create a text file with 7Kb of text > data. I run the command ? "cat test.txt > /dev/lp0" and the printer > prints everything in 1 go without any problems. > > So I don't know, I am thinking maybe this is a problem with rxtx ? > maybe I need to set some parallel parameters? Or should I try > reverting to the 2.1 version of rxtx if the parallel code is more > reliable? > > Thanks for helping After testing we found out that we need to send the text to the printer as UTF8 bytes and best to include a 50ms blocking parameter when connecting to the parallel port. So I'm glad to say that rxtx was not the problem, just me not knowing the above were a requirement. > > -- > George H > george.dma at gmail.com > From george.dma at gmail.com Wed May 19 11:17:55 2010 From: george.dma at gmail.com (George H) Date: Wed, 19 May 2010 17:17:55 +0000 Subject: [Rxtx] Resource temporarily unavailable on writeByte() Message-ID: Hi, This affects rxtx 2.1.7 and 2.2pre2 I have a POS receipt printer connected via parallel port. The BIOS is set to use SPP more for the parallel port. I am sending bytes to the parallel outputstream using the out.write(int b) method and just for safety I call flush after each write.. out.write(b); out.flush(); When I queue up arrays of bytes to be written that way, it will keep printing and then throw a "java.io.IOException: Resource temporarily unavailable in writeByte" all the time. I did a dirty workaround by pausing 2 seconds between printing receipts and it seems to postpone the error from happening, but it still happens. I thought it was maybe a threading problem from my app... so I made a program to just skip all the threading stuff and just print directly. Same problem. The below exception was thrown when using the 2.1.7 version of rxtx java.io.IOException: Resource temporarily unavailable in writeArray com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2381) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) Caused by: Resource temporarily unavailable in writeArray gnu.io.LPRPort.writeArray(Native Method) gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:281) com.gi.pos.comm.parallel.ParallelCommWriter.write(ParallelCommWriter.java:62) com.gi.pos.comm.parallel.ParallelCommWriter.writeString(ParallelCommWriter.java:52) com.gi.pos.comm.POSCommPort.writeString(POSCommPort.java:95) com.gi.resto.printer.RestoPOSPrinter.writeTwoStrings(RestoPOSPrinter.java:3045) com.gi.resto.printer.RestoPOSPrinter.writeCondimentString(RestoPOSPrinter.java:3074) com.gi.resto.printer.RestoPOSPrinter.printBillClosedReceipt(RestoPOSPrinter.java:2145) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:182) com.gi.resto.printer.RestoPOSPrinter.print(RestoPOSPrinter.java:117) com.gi.pos.PrinterEngine.processPrintJob(PrinterEngine.java:87) com.gi.pos.PrinterEngine.run(PrinterEngine.java:49) I've tried everything possible and also, I don't know if this is implemented or not but ParallelPort.isPrinterBusy() always returns false, is this normal? And it seems rxtx setting the parallel mode to EPP or ECP always throws and exception even though my bios supports those modes. Please help, this is frustrating :S -- George H george.dma at gmail.com From thomas.shulok at lmco.com Wed May 19 18:40:38 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Wed, 19 May 2010 18:40:38 -0600 Subject: [Rxtx] lock files, expected behavior? Message-ID: Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 05:05:41 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 20 May 2010 13:05:41 +0200 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, > > > > I know there are a ton of questions about lock files (I think I?ve read all > of them at this point J, but my question is slightly different. In my > application, I initially do a CommPortIdentifier.*getPortIdentifiers*(), > and I get back all my expected com ports. No problem there. Subsequently, > I acquire a port via CommPortIdentifier.*open*(). No problem. But now, > when I do a subsequent CommPortIdentifier.*getPortIdentifiers*(), the port > I acquired is no longer included in the returned enumeration. For the port > in question, the call to getPortIdentifiers produces > > > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File > exists > > > > in the log. Everything I?m doing is in one process space. I?ve confirmed > that my PID and the PID inside the lock file are the same. Does the > implementation check to see if the PID in the lock file is the same as the > PID of the caller, or does it merely check for the existence of the lock > file and bail, regardless of who the caller is? Or am I missing something > else? > > > > Thanks, > > Thom > > (rxtx-2.1.7-r2) > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.shulok at lmco.com Thu May 20 07:43:13 2010 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 20 May 2010 07:43:13 -0600 Subject: [Rxtx] lock files, expected behavior? In-Reply-To: References: Message-ID: Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas > Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point :), but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Thu May 20 07:44:35 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Thu, 20 May 2010 15:44:35 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Message-ID: Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 07:56:34 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 15:56:34 +0200 Subject: [Rxtx] lock files, expected behavior? References: Message-ID: <81AA8C26A14E43279758AA42434576D9@mdam2> Hi, sorry for previous miss-click :) Shared access to serial ports is very diffucult even if native OS. IMHO this should be done at least in JNI or LOWER/DEEPER in OS, but I don't think that RXTX does it (I am not a developer, only user). So I can only suggest to join Java applications (processes) and sort data inside joined application. Regards Mariusz ----- Original Message ----- From: Shulok, Thomas To: Mariusz Dec Cc: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:43 PM Subject: RE: [Rxtx] lock files, expected behavior? Hi Mariusz, Thanks for the response. I understand what you're saying, but my question is specifically about the treatment of the lock file when the port is accessed by the *same* process that locked it in the first place. That is, the lock mechanism is meant to prevent other processes from accessing the port, but it appears that it also prevents the same process that locked the port from accessing it as well. Said another way, if process X opens ttyS9 through rxtx, process X is no longer able to see that port via rxtx's getPortIdentifiers. I would expect that for any other process, but I would think process X would be able to see that port since process X is the creator of the lock file for that port. I'm trying to figure out if that is the expected behavior, or if once there is a lock file, no process including the one that acquired the port can access the port through any (or at least the getPortIdentifiers) rxtx API. Thanks, Thom From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, May 20, 2010 4:06 AM To: Shulok, Thomas Cc: rxtx at qbang.org Subject: Re: [Rxtx] lock files, expected behavior? Hi, without CORRECT closing port, pid file will stays always. Close port and after correct closing, exit application or reopen. Mariusz 2010/5/20 Shulok, Thomas Hi All, I know there are a ton of questions about lock files (I think I've read all of them at this point J, but my question is slightly different. In my application, I initially do a CommPortIdentifier.getPortIdentifiers(), and I get back all my expected com ports. No problem there. Subsequently, I acquire a port via CommPortIdentifier.open(). No problem. But now, when I do a subsequent CommPortIdentifier.getPortIdentifiers(), the port I acquired is no longer included in the returned enumeration. For the port in question, the call to getPortIdentifiers produces RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS9: File exists in the log. Everything I'm doing is in one process space. I've confirmed that my PID and the PID inside the lock file are the same. Does the implementation check to see if the PID in the lock file is the same as the PID of the caller, or does it merely check for the existence of the lock file and bail, regardless of who the caller is? Or am I missing something else? Thanks, Thom (rxtx-2.1.7-r2) _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu May 20 08:26:43 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Thu, 20 May 2010 16:26:43 +0200 Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver References: Message-ID: <33FE508874504BF4B3A636FCF120D7C0@mdam2> Hi, If you have copied only final jre there is not enough. Installation of the RXTX bins must be compatible with local Java and/or system paths... This is of course theory, because Java is platform independent . In w7-32 there is enough to copy rxtxSerial.dll to Windows/system32 or to Java jre folders something like that: ....Java\jre6\bin\rxtxSerial.dll Regards Mariusz ----- Original Message ----- From: Hans Rupp To: rxtx at qbang.org Sent: Thursday, May 20, 2010 3:44 PM Subject: [Rxtx] Windows 7 java.lang.UnsatisfiedLinkError: no rxtxSerial injava.library.path thrown while loading gnu.io.RXTXCommDriver Hello i got a new machine running Windows 7 64 bit. When i try to execute my old code (written and working on XP 32bit) i get following exception: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver I've installed the rxtx 2.2pre2binaries (64 bit). As i've found nothing on the web how to fix this, i have to ask the experts here ?? Anybody knows how to fix this? thanks and kind regards Hans ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu May 20 17:02:09 2010 From: george.dma at gmail.com (George H) Date: Thu, 20 May 2010 23:02:09 +0000 Subject: [Rxtx] Possible bug in ParallelImp.c Message-ID: Hi, I been looking for a reason why .isPrinterBusy() method always returns false for me and I was looking at the ParallelImp.c class and found this #if defined (__linux__) ioctl(fd, LPGETSTATUS, &status); #elif defined (WIN32) I assume this is trying to call the function from ppdev.c in the linux source code, am I right on this? If so then that method does not exist and should be "pp_ioctl" Can someone verify this for me please ? -- George H george.dma at gmail.com From cppgent0 at gmail.com Mon May 24 16:59:09 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Mon, 24 May 2010 15:59:09 -0700 Subject: [Rxtx] lockfile Message-ID: Hi, I have gotten RXTX 1.5-8 (using import gnu.io.*): laptop:~/$ sudo java -noverify -cp extensions/RXTXcomm.jar -jar x.jar RXTX-1.5-8 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 to work with Java 1.6: laptop:~$ java -version java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02) I have a null modem cable between two computers both running Ubuntu 9.10. Typing into minicom on one gets characters coming out on the other running RXTX. So far so good. A couple more things though ... 1) I've searched google and the ubuntu forums + RXTX forums for solutions to the "Illegal use of non-virtual function call", they suggest using " java -noverify" but imply that the problem is fixed in RXTX versions later than 1.4. I'm using 1.5 but have the same issue. laptop:~/$ sudo java -cp extensions/RXTXcomm.jar -jar pakmon.jar RXTX-1.5-8 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 portid: gnu.io.CommPortIdentifier at 50988 Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call Any other options? 2) The lockfile is only working if I run java under root (i.e. using sudo in Ubuntu). a) I checked the lock file permissions. From this message: RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 it looks like '/var/lock' is the lock directory. Here are the permissions: laptop:/var$ ls -al /var/lock drwxrwxrwt 2 root root 40 2010-05-24 15:45 . drwxr-xr-x 16 root root 4096 2010-05-04 11:46 .. i.e. the permissions are wide open for /var/lock b) My user id is part of uucp group: laptop:/var$ id jaxxx uid=1000(jaxxx) gid=1000(jaxxx) groups=1000(jaxxx),4(adm),10(uucp),20(dialout),21(fax),24(cdrom),30(dip),46(plugdev),104(lpadmin),112(netdev),115(admin),120(sambashare) And after adding my userid to the uucp group I rebooted so everything is there. But without using sudo I still get the message: laptop:~/$ java -noverify -cp extensions/RXTXcomm.jar -jar pakmon.jar RXTX-1.5-8 0 -1216889792 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL What else should I try to get this to work under my local userid? Thanks for your help, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From cppgent0 at gmail.com Mon May 24 17:30:28 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Mon, 24 May 2010 16:30:28 -0700 Subject: [Rxtx] lockfile In-Reply-To: References: Message-ID: I upgraded to RXTX-2.1-7 and it all works just fine: laptop:~/$ java -jar xx.jar Experimental: JNI_OnLoad called. RXTX-2.1-7 Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 portid: gnu.io.CommPortIdentifier at 1bcdbf6 (Yeah you knew this email was coming! :) Thanks anyway, John On Mon, May 24, 2010 at 3:59 PM, J Arrizza wrote: > Hi, > > I have gotten RXTX 1.5-8 (using import gnu.io.*): > > laptop:~/$ sudo java -noverify -cp extensions/RXTXcomm.jar -jar x.jar > > RXTX-1.5-8 > RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 > Found port: /dev/ttyS0 > > > to work with Java 1.6: > > > laptop:~$ java -version > java version "1.6.0_20" > Java(TM) SE Runtime Environment (build 1.6.0_20-b02) > > > > I have a null modem cable between two computers both running Ubuntu 9.10. > Typing into minicom on one gets characters coming out on the other running > RXTX. So far so good. > > A couple more things though ... > > 1) I've searched google and the ubuntu forums + RXTX forums for solutions > to the "Illegal use of non-virtual function call", they suggest using " java > -noverify" but imply that the problem is fixed in RXTX versions later than > 1.4. I'm using 1.5 but have the same issue. > > laptop:~/$ sudo java -cp extensions/RXTXcomm.jar -jar pakmon.jar > RXTX-1.5-8 > RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 > Found port: /dev/ttyS0 > portid: gnu.io.CommPortIdentifier at 50988 > Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal > use of nonvirtual function call > > > Any other options? > > 2) The lockfile is only working if I run java under root (i.e. using sudo > in Ubuntu). > > a) I checked the lock file permissions. From this message: > > RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 > > > it looks like '/var/lock' is the lock directory. Here are the permissions: > > laptop:/var$ ls -al /var/lock > drwxrwxrwt 2 root root 40 2010-05-24 15:45 . > drwxr-xr-x 16 root root 4096 2010-05-04 11:46 .. > > > i.e. the permissions are wide open for /var/lock > > b) My user id is part of uucp group: > > laptop:/var$ id jaxxx > uid=1000(jaxxx) gid=1000(jaxxx) > groups=1000(jaxxx),4(adm),10(uucp),20(dialout),21(fax),24(cdrom),30(dip),46(plugdev),104(lpadmin),112(netdev),115(admin),120(sambashare) > > > And after adding my userid to the uucp group I rebooted so everything is > there. > > But without using sudo I still get the message: > > laptop:~/$ java -noverify -cp extensions/RXTXcomm.jar -jar pakmon.jar > RXTX-1.5-8 > 0 -1216889792 > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > > What else should I try to get this to work under my local userid? > > > Thanks for your help, > John > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Thu May 27 18:08:13 2010 From: davestechshop at gmail.com (Dave) Date: Thu, 27 May 2010 20:08:13 -0400 Subject: [Rxtx] kernel panic on OS X Message-ID: Is anyone else seeing kernel panics on latest Mac OS X when disconnecting a serial device? I'm using rxtx (I've tried both 2.1-7 and 2.2pre2) and com.silabs.driver.SiLabsUSBDriver. I'm testing on a brand new clean iMac with latest OS updates. Disconnecting the serial device (a medical instrument) causes a hard crash. When I disconnect the device a certain number of times, the crash will happen. It could happen the first time or I have seen it be as many as ten times. The crash is always a kernel panic. The only variable is whether it happens on the first disconnect or the tenth, but it will happen. I'm not seeing this on WIndows or Linux (Ubuntu). Anyone else seeing anything like this? I am interested in engaging a Mac OS X expert as a consultant for up to several hours to help me resolve this. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rbreznak at neuronrobotics.com Thu May 27 18:25:54 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 27 May 2010 20:25:54 -0400 Subject: [Rxtx] kernel panic on OS X In-Reply-To: References: Message-ID: I have seen this as well on both my 24" iMac and 13" powerbook. ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com On Thu, May 27, 2010 at 8:08 PM, Dave wrote: > Is anyone else seeing kernel panics on latest Mac OS X when disconnecting a > serial device? I'm using rxtx (I've tried both 2.1-7 and 2.2pre2) > and com.silabs.driver.SiLabsUSBDriver. > > I'm testing on a brand new clean iMac with latest OS updates. Disconnecting > the serial device (a medical instrument) causes a hard crash. When I > disconnect the device a certain number of times, the crash will happen. It > could happen the first time or I have seen it be as many as ten times. The > crash is always a kernel panic. The only variable is whether it happens on > the first disconnect or the tenth, but it will happen. > > I'm not seeing this on WIndows or Linux (Ubuntu). > > Anyone else seeing anything like this? I am interested in engaging a Mac OS > X expert as a consultant for up to several hours to help me resolve this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.nielsen at shikadi.net Thu May 27 18:57:49 2010 From: a.nielsen at shikadi.net (Adam Nielsen) Date: Fri, 28 May 2010 10:57:49 +1000 Subject: [Rxtx] kernel panic on OS X In-Reply-To: References: Message-ID: <4BFF150D.5060900@shikadi.net> > Is anyone else seeing kernel panics on latest Mac OS X when > disconnecting a serial device? I'm using rxtx (I've tried both 2.1-7 and > 2.2pre2) and com.silabs.driver.SiLabsUSBDriver. FWIW I've seen this under Linux with one of the USB serial drivers. If you disconnected the USB device while the serial port was open, it would often cause a kernel crash. This was a simple bug in the device driver, and it was fixed in a later kernel version. Sounds like a similar issue. It should be fairly easy to fix if the driver is open source and you can find someone with kernel debugging experience. Cheers, Adam. From davestechshop at gmail.com Thu May 27 19:40:09 2010 From: davestechshop at gmail.com (Dave) Date: Thu, 27 May 2010 21:40:09 -0400 Subject: [Rxtx] kernel panic on OS X In-Reply-To: <4BFF150D.5060900@shikadi.net> References: <4BFF150D.5060900@shikadi.net> Message-ID: On Thu, May 27, 2010 at 8:57 PM, Adam Nielsen wrote: > Is anyone else seeing kernel panics on latest Mac OS X when disconnecting >> a serial device? I'm using rxtx (I've tried both 2.1-7 and 2.2pre2) and >> com.silabs.driver.SiLabsUSBDriver. >> > > FWIW I've seen this under Linux with one of the USB serial drivers. If you > disconnected the USB device while the serial port was open, it would often > cause a kernel crash. > > This was a simple bug in the device driver, and it was fixed in a later > kernel version. Sounds like a similar issue. It should be fairly easy to > fix if the driver is open source and you can find someone with kernel > debugging experience. > > Cheers, > Adam. > > I am not finding driver source code for the Mac drivers... Here's something I ran across in my research. Customizing Driver Installations, Macintosh OS9 and OSX If the vendor ID or product ID is changed from the default factory settings, > contact Silicon Laboratories to obtain drivers that incorporate the new > values. Macintosh requires that the drivers be compiled with the values that > will be used by the production CP210x device. In the diagnostic report, I see this value: USB Device: CP2103 USB to UART Bridge Controller, *0x10c4* (Silicon Laboratories, Inc.), *0xea60*, 0xfa141000 I wonder if those would be the vendor ID or product ID? The *0x10c4 and 0xea60* values appear in the standard SiLabs docs, so maybe that indicates that the he vendor ID and product ID are *not* changed from the default factory settings. So maybe this means nothing, but I'll post it in case it help anyone else with this issue. -------------- next part -------------- An HTML attachment was scrubbed... URL: From davestechshop at gmail.com Fri May 28 17:55:41 2010 From: davestechshop at gmail.com (Dave) Date: Fri, 28 May 2010 19:55:41 -0400 Subject: [Rxtx] kernel panic on OS X In-Reply-To: References: <4BFF150D.5060900@shikadi.net> Message-ID: On Thu, May 27, 2010 at 9:40 PM, Dave wrote: > > On Thu, May 27, 2010 at 8:57 PM, Adam Nielsen wrote: > >> Is anyone else seeing kernel panics on latest Mac OS X when disconnecting >>> a serial device? I'm using rxtx (I've tried both 2.1-7 and 2.2pre2) and >>> com.silabs.driver.SiLabsUSBDriver. >>> >> >> FWIW I've seen this under Linux with one of the USB serial drivers. If >> you disconnected the USB device while the serial port was open, it would >> often cause a kernel crash. >> >> This was a simple bug in the device driver, and it was fixed in a later >> kernel version. Sounds like a similar issue. It should be fairly easy to >> fix if the driver is open source and you can find someone with kernel >> debugging experience. >> >> Cheers, >> Adam. >> >> > I am not finding driver source code for the Mac drivers... > > Here's something I ran across in my research. > > Customizing Driver Installations, Macintosh OS9 and OSX > > If the vendor ID or product ID is changed from the default factory >> settings, contact Silicon Laboratories to obtain drivers that incorporate >> the new values. Macintosh requires that the drivers be compiled with the >> values that will be used by the production CP210x device. > > > In the diagnostic report, I see this value: > USB Device: CP2103 USB to UART Bridge Controller, *0x10c4* (Silicon > Laboratories, Inc.), *0xea60*, 0xfa141000 > > I wonder if those would be the vendor ID or product ID? The *0x10c4 and > 0xea60* values appear in the standard SiLabs docs, so maybe that indicates > that the he vendor ID and product ID are *not* changed from the default > factory settings. > > So maybe this means nothing, but I'll post it in case it help anyone else > with this issue. > FYI, I found these notes with the SiLabs CP210x driver for Mac: Known Issues and Limitations ---------------------------- This release includes the Macintosh OSX driver for the Intel and PowerPC Platforms. *There are issues with surprise removal during transfers on OSX 10.4* I submitted a ticket and support told me the following: i checked with the developer. The kernel panic on a surprise remove is a > known issue. The release notes say 10.4 because it was observed on 10.4. But > it is not limited to 10.4. > We have just completed a major re-write of the PC drivers. We are planning > a major update for the MAC drivers later this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashkan.ekhtiari at gmail.com Tue May 4 07:34:22 2010 From: ashkan.ekhtiari at gmail.com (ashkan ekhtiari) Date: Tue, 4 May 2010 15:34:22 +0200 Subject: [Rxtx] write to Serial Port Problem Message-ID: Hello, I do use serialPort on windows XP in order to write and read to a mote. The connection is made by SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); while in is InputStream and out is OutputStream , however when I write a byte array into serialPort it seems that it doesn't send it to mote. byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, -86, -86, 0, 0, 0}; out.write(timepkt); I even put out.flush(); before and after out.write(timepkt) to make sure that output buffer is empty, while it is not necessary at all. But it didn't work, I also tried to write a byte array with the same size but with all values set to zero right after the out.write() but it didn't solve the problme. Note that my mote works as following, if it doesn't receive any signal from serialPort it frequently sends a special packet which I can read and see them, in serialEvent method. It is strange for me why it reads from but doesn't send to serial port. Any one have a suggestion why it happens? Best Regards Ashkan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Tue May 4 10:44:38 2010 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 May 2010 11:44:38 -0500 Subject: [Rxtx] write to Serial Port Problem In-Reply-To: References: Message-ID: <4BE04EF6.7030604@cox.net> What flow control is active? If hardware flow control is on, is your "mote" asserting everything like CTS and CD so that you can write? Gregg Wonderly ashkan ekhtiari wrote: > Hello, > > I do use serialPort on windows XP in order to write and read to a mote. > The connection is made by > > SerialPort serialPort = (SerialPort) commPort; > > serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > > while in is InputStream and out is OutputStream , however when I write > a byte array into serialPort it seems that it doesn't send it to mote. > byte[] timepkt = new byte[]{0, -86, -86, -69, -69, 5, 0, 10, > -86, -86, 0, 0, 0}; > out.write(timepkt); > > I even put out.flush(); before and after out.write(timepkt) to make sure > that output buffer is empty, while it is not necessary at all. But it > didn't work, > > I also tried to write a byte array with the same size but with all > values set to zero right after the out.write() but it didn't solve the > problme. > > Note that my mote works as following, if it doesn't receive any signal > from serialPort it frequently sends a special packet which I can read > and see them, in serialEvent method. > It is strange for me why it reads from but doesn't send to serial port. > > Any one have a suggestion why it happens? > > Best Regards > Ashkan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From karl.weber99 at gmx.net Thu May 6 16:14:00 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 00:14:00 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux Message-ID: <201005070014.00492.karl.weber99@gmx.net> Hi, I have a GPS datalogger supporting SPP. It has two interfaces: USB and bluetooth. The USB device file is /dev/ttyACM0. My program is working perfectly with this device. The bluetooth device file is /dev/rfcomm0. This device file is working, since cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the PC. However, if I switch the port name in my program from /dev/ttyACM0 to /dev/rfcomm0, it dumps when I send the first command to the logger with the IOException "transport endpoint is not connected in writeArray". Any ideas? /Karl From mariusz.dec at gmail.com Fri May 7 00:17:22 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 7 May 2010 08:17:22 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: <201005070014.00492.karl.weber99@gmx.net> References: <201005070014.00492.karl.weber99@gmx.net> Message-ID: 2010/5/7 Karl Weber > Hi, > > I have a GPS datalogger supporting SPP. It has two interfaces: USB and > bluetooth. > > The USB device file is /dev/ttyACM0. My program is working perfectly with > this > device. > > The bluetooth device file is /dev/rfcomm0. This device file is working, > since > cat /dev/rfcomm0 will show the stream of bytes the logger is sending to the > PC. > > However, if I switch the port name in my program from /dev/ttyACM0 > to /dev/rfcomm0, it dumps when I send the first command to the logger with > the IOException "transport endpoint is not connected in writeArray". > > Any ideas? > > Does RXTX lookup for Com ports shows /dev/rfcomm0? Maybe from the RXTX point of view it isn't serial port? regards Mariusz > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri May 7 13:08:31 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 7 May 2010 21:08:31 +0200 Subject: [Rxtx] RXTX not working with bluetooth on linux In-Reply-To: References: <201005070014.00492.karl.weber99@gmx.net> <201005071539.50092.karl.weber99@gmx.net> Message-ID: <201005072108.31331.karl.weber99@gmx.net> Am Freitag, 7. Mai 2010 16:40 schrieb Mariusz Dec: > 2010/5/7 Karl Weber > > > Am Freitag, 7. Mai 2010 08:17 schrieben Sie: [...] > > I have seen many times that bluetooth trough COM ports works with some > unpredictable problems - quality of the drivers. > Did you see also timing problems? > In this last case (Invalid Parameter) I suppose to check available speeds The parameters are o.k. I know now, see below. > > I don't know on which