From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From leo.guimaraes at gmail.com Fri Jun 18 13:29:14 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Fri, 18 Jun 2010 15:29:14 -0400 Subject: [Rxtx] Virtual Port with RXTX Message-ID: Hello everybody, Please, im crazy trying to solve this problem: I created a virtual port in my server to receive data over the ethernet from a serial port in the client machine. Im using socat for that: In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: 192.168.102.41:54321 its working fine for me, accessing the virtual port via CuteCom or any terminal. But i can't access this port via RXTX. The getPortIdentifiers() method returns only the /dev/ttyS0 port. Please guys, could you help me about that? Thank you very much! Leandro Guimar?es -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Fri Jun 18 23:43:50 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 19 Jun 2010 07:43:50 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: Hi, In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: > 192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or any > terminal. But i can't access this port via RXTX. The getPortIdentifiers() > method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock Try to change name of the virtual port. I suppose you are using Linux, so: In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid prefixes for the Linux com ports. Add your prefix there or change your VCP name to match to any predefined prefix there. Regards Mariusz > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From leo.guimaraes at gmail.com Fri Jun 18 13:29:14 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Fri, 18 Jun 2010 15:29:14 -0400 Subject: [Rxtx] Virtual Port with RXTX Message-ID: Hello everybody, Please, im crazy trying to solve this problem: I created a virtual port in my server to receive data over the ethernet from a serial port in the client machine. Im using socat for that: In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: 192.168.102.41:54321 its working fine for me, accessing the virtual port via CuteCom or any terminal. But i can't access this port via RXTX. The getPortIdentifiers() method returns only the /dev/ttyS0 port. Please guys, could you help me about that? Thank you very much! Leandro Guimar?es -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Fri Jun 18 23:43:50 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 19 Jun 2010 07:43:50 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: Hi, In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: > 192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or any > terminal. But i can't access this port via RXTX. The getPortIdentifiers() > method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock Try to change name of the virtual port. I suppose you are using Linux, so: In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid prefixes for the Linux com ports. Add your prefix there or change your VCP name to match to any predefined prefix there. Regards Mariusz > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Sat Jun 19 08:03:06 2010 From: jredman at ergotech.com (Jim Redman) Date: Sat, 19 Jun 2010 08:03:06 -0600 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: <4C1CCE1A.90201@ergotech.com> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports so: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 or whatever you need for the virtual port. The ports will enumerate in the order give (I don't know whether this is a guaranteed behavior or just the way it happens to be). Jim On 06/18/2010 11:43 PM, Mariusz Dec wrote: > Hi, > > In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > tcp:192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or > any terminal. But i can't access this port via RXTX. The > getPortIdentifiers() method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork > file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > > Try to change name of the virtual port. > > I suppose you are using Linux, so: > > In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > prefixes for the Linux com ports. > Add your prefix there or change your VCP name to match to any predefined > prefix there. > > Regards > Mariusz > > > > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From leo.guimaraes at gmail.com Fri Jun 18 13:29:14 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Fri, 18 Jun 2010 15:29:14 -0400 Subject: [Rxtx] Virtual Port with RXTX Message-ID: Hello everybody, Please, im crazy trying to solve this problem: I created a virtual port in my server to receive data over the ethernet from a serial port in the client machine. Im using socat for that: In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: 192.168.102.41:54321 its working fine for me, accessing the virtual port via CuteCom or any terminal. But i can't access this port via RXTX. The getPortIdentifiers() method returns only the /dev/ttyS0 port. Please guys, could you help me about that? Thank you very much! Leandro Guimar?es -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Fri Jun 18 23:43:50 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 19 Jun 2010 07:43:50 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: Hi, In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: > 192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or any > terminal. But i can't access this port via RXTX. The getPortIdentifiers() > method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock Try to change name of the virtual port. I suppose you are using Linux, so: In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid prefixes for the Linux com ports. Add your prefix there or change your VCP name to match to any predefined prefix there. Regards Mariusz > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Sat Jun 19 08:03:06 2010 From: jredman at ergotech.com (Jim Redman) Date: Sat, 19 Jun 2010 08:03:06 -0600 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: <4C1CCE1A.90201@ergotech.com> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports so: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 or whatever you need for the virtual port. The ports will enumerate in the order give (I don't know whether this is a guaranteed behavior or just the way it happens to be). Jim On 06/18/2010 11:43 PM, Mariusz Dec wrote: > Hi, > > In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > tcp:192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or > any terminal. But i can't access this port via RXTX. The > getPortIdentifiers() method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork > file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > > Try to change name of the virtual port. > > I suppose you are using Linux, so: > > In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > prefixes for the Linux com ports. > Add your prefix there or change your VCP name to match to any predefined > prefix there. > > Regards > Mariusz > > > > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From leo.guimaraes at gmail.com Fri Jun 18 13:29:14 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Fri, 18 Jun 2010 15:29:14 -0400 Subject: [Rxtx] Virtual Port with RXTX Message-ID: Hello everybody, Please, im crazy trying to solve this problem: I created a virtual port in my server to receive data over the ethernet from a serial port in the client machine. Im using socat for that: In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: 192.168.102.41:54321 its working fine for me, accessing the virtual port via CuteCom or any terminal. But i can't access this port via RXTX. The getPortIdentifiers() method returns only the /dev/ttyS0 port. Please guys, could you help me about that? Thank you very much! Leandro Guimar?es -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Fri Jun 18 23:43:50 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 19 Jun 2010 07:43:50 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: Hi, In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: > 192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or any > terminal. But i can't access this port via RXTX. The getPortIdentifiers() > method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock Try to change name of the virtual port. I suppose you are using Linux, so: In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid prefixes for the Linux com ports. Add your prefix there or change your VCP name to match to any predefined prefix there. Regards Mariusz > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Sat Jun 19 08:03:06 2010 From: jredman at ergotech.com (Jim Redman) Date: Sat, 19 Jun 2010 08:03:06 -0600 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: <4C1CCE1A.90201@ergotech.com> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports so: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 or whatever you need for the virtual port. The ports will enumerate in the order give (I don't know whether this is a guaranteed behavior or just the way it happens to be). Jim On 06/18/2010 11:43 PM, Mariusz Dec wrote: > Hi, > > In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > tcp:192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or > any terminal. But i can't access this port via RXTX. The > getPortIdentifiers() method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork > file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > > Try to change name of the virtual port. > > I suppose you are using Linux, so: > > In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > prefixes for the Linux com ports. > Add your prefix there or change your VCP name to match to any predefined > prefix there. > > Regards > Mariusz > > > > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From leo.guimaraes at gmail.com Mon Jun 21 13:23:26 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 16:23:26 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: <4C1CCE1A.90201@ergotech.com> References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hello, Change my virtual port to ttySXX worked fine... But now, im having another problem... I dont know why, but the virtual port is never calling the SerialEvent in the SerialPortEventListenner... using the real Serial port, works fine. But it doesnt work with the virtual port... Somebody have an idea?? Pleasse! Thank you!! Leandro Guimar?es On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: > You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > so: > > > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > > or whatever you need for the virtual port. The ports will enumerate in the > order give (I don't know whether this is a guaranteed behavior or just the > way it happens to be). > > Jim > > > > > On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> Hi, >> >> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave >> tcp:192.168.102.41:54321 >> >> >> its working fine for me, accessing the virtual port via CuteCom or >> any terminal. But i can't access this port via RXTX. The >> getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >> Please guys, could you help me about that? >> >> >> In client machine: socat tcp-l:54321,reuseaddr,fork >> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >> Try to change name of the virtual port. >> >> I suppose you are using Linux, so: >> >> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> prefixes for the Linux com ports. >> Add your prefix there or change your VCP name to match to any predefined >> prefix there. >> >> Regards >> Mariusz >> >> >> >> Thank you very much! >> Leandro Guimar?es >> >> >> _______________________________________________ >> 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 >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > > _______________________________________________ > 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 Mon Jun 21 13:47:13 2010 From: george.dma at gmail.com (George H) Date: Mon, 21 Jun 2010 19:47:13 +0000 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, This might be because it is a virtual port. I used to do testing on usb/serial port and there were some "signals" it would not send me that a real serial port would. Try to see what signals your serial port sends you that the virtual port doesn't. I think there are some serial port sniffers out there where you can intercept the signals. Also would do good if you look at some technical tutorials on how serial port signals work. A good site which I read over many times to try to understand why things are the way they are is http://www.arcelect.com/rs232.htm I hope this gave you some ideas. Good luck -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Hello, > > ?? Change my virtual port to ttySXX worked fine... > > ?? But now, im having another problem... > > ? I dont know why, but the virtual port is never calling the SerialEvent in > the SerialPortEventListenner... using the real Serial port, works fine. But > it doesnt work with the virtual port... > > > ?? Somebody have an idea?? Pleasse! > > Thank you!! > Leandro Guimar?es > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports >> so: >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> the order give (I don't know whether this is a guaranteed behavior or just >> the way it happens to be). >> >> Jim >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >>> >>> Hi, >>> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >>> ? ?tcp:192.168.102.41:54321 >>> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >>> ? ?any terminal. But i can't access this port via RXTX. The >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >>> >>> ? ? ? Please guys, could you help me about that? >>> >>> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >>> >>> Try to change name of the virtual port. >>> >>> I suppose you are using Linux, so: >>> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >>> prefixes for the Linux com ports. >>> Add your prefix there or change your VCP name to match to any predefined >>> prefix there. >>> >>> Regards >>> Mariusz >>> >>> >>> >>> ? ?Thank you very much! >>> ? ?Leandro Guimar?es >>> >>> >>> ? ?_______________________________________________ >>> ? ?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 >> >> -- >> Jim Redman >> (505) 662 5156 x85 >> http://www.ergotech.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From leo.guimaraes at gmail.com Mon Jun 21 14:56:15 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 17:56:15 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Thanks George, Please, do you know what represents a "data available" in RXTX? Wich signal calls the Listener's Notify? Its the last thing that i need to do to finish my project here! Thank you very much! Leandro Guimar?es 2010/6/21 George H > Hi, > > This might be because it is a virtual port. > I used to do testing on usb/serial port and there were some "signals" > it would not send me that a real serial port would. > Try to see what signals your serial port sends you that the virtual > port doesn't. I think there are some serial port sniffers out there > where you can intercept the signals. Also would do good if you look at > some technical tutorials on how serial port signals work. > > A good site which I read over many times to try to understand why > things are the way they are is http://www.arcelect.com/rs232.htm > > I hope this gave you some ideas. > Good luck > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Hello, > > > > Change my virtual port to ttySXX worked fine... > > > > But now, im having another problem... > > > > I dont know why, but the virtual port is never calling the SerialEvent > in > > the SerialPortEventListenner... using the real Serial port, works fine. > But > > it doesnt work with the virtual port... > > > > > > Somebody have an idea?? Pleasse! > > > > Thank you!! > > Leandro Guimar?es > > > > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > wrote: > >> > >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > >> so: > >> > >> > >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> > >> or whatever you need for the virtual port. The ports will enumerate in > >> the order give (I don't know whether this is a guaranteed behavior or > just > >> the way it happens to be). > >> > >> Jim > >> > >> > >> > >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >>> > >>> Hi, > >>> > >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >>> tcp:192.168.102.41:54321 > >>> > >>> its working fine for me, accessing the virtual port via CuteCom or > >>> any terminal. But i can't access this port via RXTX. The > >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >>> > >>> Please guys, could you help me about that? > >>> > >>> > >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >>> > >>> Try to change name of the virtual port. > >>> > >>> I suppose you are using Linux, so: > >>> > >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >>> prefixes for the Linux com ports. > >>> Add your prefix there or change your VCP name to match to any > predefined > >>> prefix there. > >>> > >>> Regards > >>> Mariusz > >>> > >>> > >>> > >>> Thank you very much! > >>> Leandro Guimar?es > >>> > >>> > >>> _______________________________________________ > >>> 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 > >> > >> -- > >> Jim Redman > >> (505) 662 5156 x85 > >> http://www.ergotech.com > >> _______________________________________________ > >> 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 george.dma at gmail.com Mon Jun 21 22:51:50 2010 From: george.dma at gmail.com (George H) Date: Tue, 22 Jun 2010 07:51:50 +0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Did you read the site I posted? If you did you would have figured out which pin signal on the RS232 interface most likely triggers the data available event. It might be pin 2 and it might be pin 3, depends what kind of serial port you have and the cable. Plus i'm no expert on on RS-232 interfaces, I just know that if I have my hardware in front of me, and the source code of rxtx and a rs-232 specifications sheet then I can debug the problem and find out. This is what I believe you should do to get started to find out the "what, where and why" of your problem. -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Thanks George, > > ?? Please, do you know what represents a "data available" in RXTX? Wich > signal calls the Listener's Notify? > > ?? Its the last thing that i need to do to finish my project here! > > Thank you very much! > > Leandro Guimar?es > > > 2010/6/21 George H >> >> Hi, >> >> This might be because it is a virtual port. >> I used to do testing on usb/serial port and there were some "signals" >> it would not send me that a real serial port would. >> Try to see what signals your serial port sends you that the virtual >> port doesn't. I think there are some serial port sniffers out there >> where you can intercept the signals. Also would do good if you look at >> some technical tutorials on how serial port signals work. >> >> A good site which I read over many times to try to understand why >> things are the way they are is http://www.arcelect.com/rs232.htm >> >> I hope this gave you some ideas. >> Good luck >> -- >> George H >> george.dma at gmail.com >> >> >> >> 2010/6/21 Leandro Guimar?es : >> > Hello, >> > >> > ?? Change my virtual port to ttySXX worked fine... >> > >> > ?? But now, im having another problem... >> > >> > ? I dont know why, but the virtual port is never calling the SerialEvent >> > in >> > the SerialPortEventListenner... using the real Serial port, works fine. >> > But >> > it doesnt work with the virtual port... >> > >> > >> > ?? Somebody have an idea?? Pleasse! >> > >> > Thank you!! >> > Leandro Guimar?es >> > >> > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman >> > wrote: >> >> >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of >> >> ports >> >> so: >> >> >> >> >> >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> >> the order give (I don't know whether this is a guaranteed behavior or >> >> just >> >> the way it happens to be). >> >> >> >> Jim >> >> >> >> >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >> >>> >> >>> Hi, >> >>> >> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >> >>> ? ?tcp:192.168.102.41:54321 >> >>> >> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >> >>> ? ?any terminal. But i can't access this port via RXTX. The >> >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >>> >> >>> ? ? ? Please guys, could you help me about that? >> >>> >> >>> >> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >>> >> >>> Try to change name of the virtual port. >> >>> >> >>> I suppose you are using Linux, so: >> >>> >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> >>> prefixes for the Linux com ports. >> >>> Add your prefix there or change your VCP name to match to any >> >>> predefined >> >>> prefix there. >> >>> >> >>> Regards >> >>> Mariusz >> >>> >> >>> >> >>> >> >>> ? ?Thank you very much! >> >>> ? ?Leandro Guimar?es >> >>> >> >>> >> >>> ? ?_______________________________________________ >> >>> ? ?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 >> >> >> >> -- >> >> Jim Redman >> >> (505) 662 5156 x85 >> >> http://www.ergotech.com >> >> _______________________________________________ >> >> Rxtx mailing list >> >> Rxtx at qbang.org >> >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > >> > _______________________________________________ >> > Rxtx mailing list >> > Rxtx at qbang.org >> > http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > > > From mariusz.dec at gmail.com Tue Jun 22 05:32:01 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 22 Jun 2010 13:32:01 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, I am working with virtual ports only. Because of some problems with events I have changed whole idea. I did a thread in Java which is looking for port data in pool. If data comes in, I parse it and than generate an Java exception for the application. This works very good from several months and has an advantage more - is faster than events services. I have published many times an example code. Look for 2009'november thread "RXTX close() problem solved". In this example you can set Exception generation in read thread. There is a lot of "try-catch" loops which prevents system while you disconnect USB as well. For me works very good in Mac/Linux and Windows. Regards Mariusz 2010/6/22 George H > Did you read the site I posted? If you did you would have figured out > which pin signal on the RS232 interface most likely triggers the data > available event. > It might be pin 2 and it might be pin 3, depends what kind of serial > port you have and the cable. > > Plus i'm no expert on on RS-232 interfaces, I just know that if I have > my hardware in front of me, and the source code of rxtx and a rs-232 > specifications sheet then I can debug the problem and find out. This > is what I believe you should do to get started to find out the "what, > where and why" of your problem. > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Thanks George, > > > > Please, do you know what represents a "data available" in RXTX? Wich > > signal calls the Listener's Notify? > > > > Its the last thing that i need to do to finish my project here! > > > > Thank you very much! > > > > Leandro Guimar?es > > > > > > 2010/6/21 George H > >> > >> Hi, > >> > >> This might be because it is a virtual port. > >> I used to do testing on usb/serial port and there were some "signals" > >> it would not send me that a real serial port would. > >> Try to see what signals your serial port sends you that the virtual > >> port doesn't. I think there are some serial port sniffers out there > >> where you can intercept the signals. Also would do good if you look at > >> some technical tutorials on how serial port signals work. > >> > >> A good site which I read over many times to try to understand why > >> things are the way they are is http://www.arcelect.com/rs232.htm > >> > >> I hope this gave you some ideas. > >> Good luck > >> -- > >> George H > >> george.dma at gmail.com > >> > >> > >> > >> 2010/6/21 Leandro Guimar?es : > >> > Hello, > >> > > >> > Change my virtual port to ttySXX worked fine... > >> > > >> > But now, im having another problem... > >> > > >> > I dont know why, but the virtual port is never calling the > SerialEvent > >> > in > >> > the SerialPortEventListenner... using the real Serial port, works > fine. > >> > But > >> > it doesnt work with the virtual port... > >> > > >> > > >> > Somebody have an idea?? Pleasse! > >> > > >> > Thank you!! > >> > Leandro Guimar?es > >> > > >> > > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > >> > wrote: > >> >> > >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of > >> >> ports > >> >> so: > >> >> > >> >> > >> >> > >> >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> >> > >> >> or whatever you need for the virtual port. The ports will enumerate > in > >> >> the order give (I don't know whether this is a guaranteed behavior or > >> >> just > >> >> the way it happens to be). > >> >> > >> >> Jim > >> >> > >> >> > >> >> > >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> >>> > >> >>> Hi, > >> >>> > >> >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >> >>> tcp:192.168.102.41:54321 > >> >>> > >> >>> its working fine for me, accessing the virtual port via CuteCom > or > >> >>> any terminal. But i can't access this port via RXTX. The > >> >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >> >>> > >> >>> Please guys, could you help me about that? > >> >>> > >> >>> > >> >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >> >>> > >> >>> Try to change name of the virtual port. > >> >>> > >> >>> I suppose you are using Linux, so: > >> >>> > >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >> >>> prefixes for the Linux com ports. > >> >>> Add your prefix there or change your VCP name to match to any > >> >>> predefined > >> >>> prefix there. > >> >>> > >> >>> Regards > >> >>> Mariusz > >> >>> > >> >>> > >> >>> > >> >>> Thank you very much! > >> >>> Leandro Guimar?es > >> >>> > >> >>> > >> >>> _______________________________________________ > >> >>> 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 > >> >> > >> >> -- > >> >> Jim Redman > >> >> (505) 662 5156 x85 > >> >> http://www.ergotech.com > >> >> _______________________________________________ > >> >> 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 > >> > > >> > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Tue Jun 22 07:20:17 2010 From: showard314 at gmail.com (Scott Howard) Date: Tue, 22 Jun 2010 09:20:17 -0400 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails Message-ID: This is forwarded from: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472053 by Jan Niehusmann I tried putting this on the bug tracker but I couldn't get access In the static initializer of gnu.io.RXTXPort, an exception when initializing the static variable 'z' is silently discarded: try { z = new Zystem(); } catch ( Exception e ) {}; This leads to NullPointerExceptions later, which are difficult to debug as the original exception is lost. I did change the code to try { z = new Zystem(); } catch ( Exception e ) { throw new Error(e.toString()); }; for debugging. Probably a more specific exception would be more appropriate, but the point is that leaving z undefined without reporting an error makes debugging unnecessarily difficult. Thanks. From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From leo.guimaraes at gmail.com Fri Jun 18 13:29:14 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Fri, 18 Jun 2010 15:29:14 -0400 Subject: [Rxtx] Virtual Port with RXTX Message-ID: Hello everybody, Please, im crazy trying to solve this problem: I created a virtual port in my server to receive data over the ethernet from a serial port in the client machine. Im using socat for that: In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: 192.168.102.41:54321 its working fine for me, accessing the virtual port via CuteCom or any terminal. But i can't access this port via RXTX. The getPortIdentifiers() method returns only the /dev/ttyS0 port. Please guys, could you help me about that? Thank you very much! Leandro Guimar?es -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Fri Jun 18 23:43:50 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 19 Jun 2010 07:43:50 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: Hi, In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: > 192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or any > terminal. But i can't access this port via RXTX. The getPortIdentifiers() > method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock Try to change name of the virtual port. I suppose you are using Linux, so: In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid prefixes for the Linux com ports. Add your prefix there or change your VCP name to match to any predefined prefix there. Regards Mariusz > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Sat Jun 19 08:03:06 2010 From: jredman at ergotech.com (Jim Redman) Date: Sat, 19 Jun 2010 08:03:06 -0600 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: <4C1CCE1A.90201@ergotech.com> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports so: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 or whatever you need for the virtual port. The ports will enumerate in the order give (I don't know whether this is a guaranteed behavior or just the way it happens to be). Jim On 06/18/2010 11:43 PM, Mariusz Dec wrote: > Hi, > > In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > tcp:192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or > any terminal. But i can't access this port via RXTX. The > getPortIdentifiers() method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork > file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > > Try to change name of the virtual port. > > I suppose you are using Linux, so: > > In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > prefixes for the Linux com ports. > Add your prefix there or change your VCP name to match to any predefined > prefix there. > > Regards > Mariusz > > > > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From leo.guimaraes at gmail.com Mon Jun 21 13:23:26 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 16:23:26 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: <4C1CCE1A.90201@ergotech.com> References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hello, Change my virtual port to ttySXX worked fine... But now, im having another problem... I dont know why, but the virtual port is never calling the SerialEvent in the SerialPortEventListenner... using the real Serial port, works fine. But it doesnt work with the virtual port... Somebody have an idea?? Pleasse! Thank you!! Leandro Guimar?es On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: > You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > so: > > > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > > or whatever you need for the virtual port. The ports will enumerate in the > order give (I don't know whether this is a guaranteed behavior or just the > way it happens to be). > > Jim > > > > > On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> Hi, >> >> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave >> tcp:192.168.102.41:54321 >> >> >> its working fine for me, accessing the virtual port via CuteCom or >> any terminal. But i can't access this port via RXTX. The >> getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >> Please guys, could you help me about that? >> >> >> In client machine: socat tcp-l:54321,reuseaddr,fork >> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >> Try to change name of the virtual port. >> >> I suppose you are using Linux, so: >> >> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> prefixes for the Linux com ports. >> Add your prefix there or change your VCP name to match to any predefined >> prefix there. >> >> Regards >> Mariusz >> >> >> >> Thank you very much! >> Leandro Guimar?es >> >> >> _______________________________________________ >> 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 >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > > _______________________________________________ > 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 Mon Jun 21 13:47:13 2010 From: george.dma at gmail.com (George H) Date: Mon, 21 Jun 2010 19:47:13 +0000 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, This might be because it is a virtual port. I used to do testing on usb/serial port and there were some "signals" it would not send me that a real serial port would. Try to see what signals your serial port sends you that the virtual port doesn't. I think there are some serial port sniffers out there where you can intercept the signals. Also would do good if you look at some technical tutorials on how serial port signals work. A good site which I read over many times to try to understand why things are the way they are is http://www.arcelect.com/rs232.htm I hope this gave you some ideas. Good luck -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Hello, > > ?? Change my virtual port to ttySXX worked fine... > > ?? But now, im having another problem... > > ? I dont know why, but the virtual port is never calling the SerialEvent in > the SerialPortEventListenner... using the real Serial port, works fine. But > it doesnt work with the virtual port... > > > ?? Somebody have an idea?? Pleasse! > > Thank you!! > Leandro Guimar?es > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports >> so: >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> the order give (I don't know whether this is a guaranteed behavior or just >> the way it happens to be). >> >> Jim >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >>> >>> Hi, >>> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >>> ? ?tcp:192.168.102.41:54321 >>> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >>> ? ?any terminal. But i can't access this port via RXTX. The >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >>> >>> ? ? ? Please guys, could you help me about that? >>> >>> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >>> >>> Try to change name of the virtual port. >>> >>> I suppose you are using Linux, so: >>> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >>> prefixes for the Linux com ports. >>> Add your prefix there or change your VCP name to match to any predefined >>> prefix there. >>> >>> Regards >>> Mariusz >>> >>> >>> >>> ? ?Thank you very much! >>> ? ?Leandro Guimar?es >>> >>> >>> ? ?_______________________________________________ >>> ? ?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 >> >> -- >> Jim Redman >> (505) 662 5156 x85 >> http://www.ergotech.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From leo.guimaraes at gmail.com Mon Jun 21 14:56:15 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 17:56:15 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Thanks George, Please, do you know what represents a "data available" in RXTX? Wich signal calls the Listener's Notify? Its the last thing that i need to do to finish my project here! Thank you very much! Leandro Guimar?es 2010/6/21 George H > Hi, > > This might be because it is a virtual port. > I used to do testing on usb/serial port and there were some "signals" > it would not send me that a real serial port would. > Try to see what signals your serial port sends you that the virtual > port doesn't. I think there are some serial port sniffers out there > where you can intercept the signals. Also would do good if you look at > some technical tutorials on how serial port signals work. > > A good site which I read over many times to try to understand why > things are the way they are is http://www.arcelect.com/rs232.htm > > I hope this gave you some ideas. > Good luck > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Hello, > > > > Change my virtual port to ttySXX worked fine... > > > > But now, im having another problem... > > > > I dont know why, but the virtual port is never calling the SerialEvent > in > > the SerialPortEventListenner... using the real Serial port, works fine. > But > > it doesnt work with the virtual port... > > > > > > Somebody have an idea?? Pleasse! > > > > Thank you!! > > Leandro Guimar?es > > > > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > wrote: > >> > >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > >> so: > >> > >> > >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> > >> or whatever you need for the virtual port. The ports will enumerate in > >> the order give (I don't know whether this is a guaranteed behavior or > just > >> the way it happens to be). > >> > >> Jim > >> > >> > >> > >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >>> > >>> Hi, > >>> > >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >>> tcp:192.168.102.41:54321 > >>> > >>> its working fine for me, accessing the virtual port via CuteCom or > >>> any terminal. But i can't access this port via RXTX. The > >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >>> > >>> Please guys, could you help me about that? > >>> > >>> > >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >>> > >>> Try to change name of the virtual port. > >>> > >>> I suppose you are using Linux, so: > >>> > >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >>> prefixes for the Linux com ports. > >>> Add your prefix there or change your VCP name to match to any > predefined > >>> prefix there. > >>> > >>> Regards > >>> Mariusz > >>> > >>> > >>> > >>> Thank you very much! > >>> Leandro Guimar?es > >>> > >>> > >>> _______________________________________________ > >>> 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 > >> > >> -- > >> Jim Redman > >> (505) 662 5156 x85 > >> http://www.ergotech.com > >> _______________________________________________ > >> 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 george.dma at gmail.com Mon Jun 21 22:51:50 2010 From: george.dma at gmail.com (George H) Date: Tue, 22 Jun 2010 07:51:50 +0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Did you read the site I posted? If you did you would have figured out which pin signal on the RS232 interface most likely triggers the data available event. It might be pin 2 and it might be pin 3, depends what kind of serial port you have and the cable. Plus i'm no expert on on RS-232 interfaces, I just know that if I have my hardware in front of me, and the source code of rxtx and a rs-232 specifications sheet then I can debug the problem and find out. This is what I believe you should do to get started to find out the "what, where and why" of your problem. -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Thanks George, > > ?? Please, do you know what represents a "data available" in RXTX? Wich > signal calls the Listener's Notify? > > ?? Its the last thing that i need to do to finish my project here! > > Thank you very much! > > Leandro Guimar?es > > > 2010/6/21 George H >> >> Hi, >> >> This might be because it is a virtual port. >> I used to do testing on usb/serial port and there were some "signals" >> it would not send me that a real serial port would. >> Try to see what signals your serial port sends you that the virtual >> port doesn't. I think there are some serial port sniffers out there >> where you can intercept the signals. Also would do good if you look at >> some technical tutorials on how serial port signals work. >> >> A good site which I read over many times to try to understand why >> things are the way they are is http://www.arcelect.com/rs232.htm >> >> I hope this gave you some ideas. >> Good luck >> -- >> George H >> george.dma at gmail.com >> >> >> >> 2010/6/21 Leandro Guimar?es : >> > Hello, >> > >> > ?? Change my virtual port to ttySXX worked fine... >> > >> > ?? But now, im having another problem... >> > >> > ? I dont know why, but the virtual port is never calling the SerialEvent >> > in >> > the SerialPortEventListenner... using the real Serial port, works fine. >> > But >> > it doesnt work with the virtual port... >> > >> > >> > ?? Somebody have an idea?? Pleasse! >> > >> > Thank you!! >> > Leandro Guimar?es >> > >> > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman >> > wrote: >> >> >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of >> >> ports >> >> so: >> >> >> >> >> >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> >> the order give (I don't know whether this is a guaranteed behavior or >> >> just >> >> the way it happens to be). >> >> >> >> Jim >> >> >> >> >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >> >>> >> >>> Hi, >> >>> >> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >> >>> ? ?tcp:192.168.102.41:54321 >> >>> >> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >> >>> ? ?any terminal. But i can't access this port via RXTX. The >> >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >>> >> >>> ? ? ? Please guys, could you help me about that? >> >>> >> >>> >> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >>> >> >>> Try to change name of the virtual port. >> >>> >> >>> I suppose you are using Linux, so: >> >>> >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> >>> prefixes for the Linux com ports. >> >>> Add your prefix there or change your VCP name to match to any >> >>> predefined >> >>> prefix there. >> >>> >> >>> Regards >> >>> Mariusz >> >>> >> >>> >> >>> >> >>> ? ?Thank you very much! >> >>> ? ?Leandro Guimar?es >> >>> >> >>> >> >>> ? ?_______________________________________________ >> >>> ? ?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 >> >> >> >> -- >> >> Jim Redman >> >> (505) 662 5156 x85 >> >> http://www.ergotech.com >> >> _______________________________________________ >> >> Rxtx mailing list >> >> Rxtx at qbang.org >> >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > >> > _______________________________________________ >> > Rxtx mailing list >> > Rxtx at qbang.org >> > http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > > > From mariusz.dec at gmail.com Tue Jun 22 05:32:01 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 22 Jun 2010 13:32:01 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, I am working with virtual ports only. Because of some problems with events I have changed whole idea. I did a thread in Java which is looking for port data in pool. If data comes in, I parse it and than generate an Java exception for the application. This works very good from several months and has an advantage more - is faster than events services. I have published many times an example code. Look for 2009'november thread "RXTX close() problem solved". In this example you can set Exception generation in read thread. There is a lot of "try-catch" loops which prevents system while you disconnect USB as well. For me works very good in Mac/Linux and Windows. Regards Mariusz 2010/6/22 George H > Did you read the site I posted? If you did you would have figured out > which pin signal on the RS232 interface most likely triggers the data > available event. > It might be pin 2 and it might be pin 3, depends what kind of serial > port you have and the cable. > > Plus i'm no expert on on RS-232 interfaces, I just know that if I have > my hardware in front of me, and the source code of rxtx and a rs-232 > specifications sheet then I can debug the problem and find out. This > is what I believe you should do to get started to find out the "what, > where and why" of your problem. > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Thanks George, > > > > Please, do you know what represents a "data available" in RXTX? Wich > > signal calls the Listener's Notify? > > > > Its the last thing that i need to do to finish my project here! > > > > Thank you very much! > > > > Leandro Guimar?es > > > > > > 2010/6/21 George H > >> > >> Hi, > >> > >> This might be because it is a virtual port. > >> I used to do testing on usb/serial port and there were some "signals" > >> it would not send me that a real serial port would. > >> Try to see what signals your serial port sends you that the virtual > >> port doesn't. I think there are some serial port sniffers out there > >> where you can intercept the signals. Also would do good if you look at > >> some technical tutorials on how serial port signals work. > >> > >> A good site which I read over many times to try to understand why > >> things are the way they are is http://www.arcelect.com/rs232.htm > >> > >> I hope this gave you some ideas. > >> Good luck > >> -- > >> George H > >> george.dma at gmail.com > >> > >> > >> > >> 2010/6/21 Leandro Guimar?es : > >> > Hello, > >> > > >> > Change my virtual port to ttySXX worked fine... > >> > > >> > But now, im having another problem... > >> > > >> > I dont know why, but the virtual port is never calling the > SerialEvent > >> > in > >> > the SerialPortEventListenner... using the real Serial port, works > fine. > >> > But > >> > it doesnt work with the virtual port... > >> > > >> > > >> > Somebody have an idea?? Pleasse! > >> > > >> > Thank you!! > >> > Leandro Guimar?es > >> > > >> > > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > >> > wrote: > >> >> > >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of > >> >> ports > >> >> so: > >> >> > >> >> > >> >> > >> >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> >> > >> >> or whatever you need for the virtual port. The ports will enumerate > in > >> >> the order give (I don't know whether this is a guaranteed behavior or > >> >> just > >> >> the way it happens to be). > >> >> > >> >> Jim > >> >> > >> >> > >> >> > >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> >>> > >> >>> Hi, > >> >>> > >> >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >> >>> tcp:192.168.102.41:54321 > >> >>> > >> >>> its working fine for me, accessing the virtual port via CuteCom > or > >> >>> any terminal. But i can't access this port via RXTX. The > >> >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >> >>> > >> >>> Please guys, could you help me about that? > >> >>> > >> >>> > >> >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >> >>> > >> >>> Try to change name of the virtual port. > >> >>> > >> >>> I suppose you are using Linux, so: > >> >>> > >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >> >>> prefixes for the Linux com ports. > >> >>> Add your prefix there or change your VCP name to match to any > >> >>> predefined > >> >>> prefix there. > >> >>> > >> >>> Regards > >> >>> Mariusz > >> >>> > >> >>> > >> >>> > >> >>> Thank you very much! > >> >>> Leandro Guimar?es > >> >>> > >> >>> > >> >>> _______________________________________________ > >> >>> 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 > >> >> > >> >> -- > >> >> Jim Redman > >> >> (505) 662 5156 x85 > >> >> http://www.ergotech.com > >> >> _______________________________________________ > >> >> 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 > >> > > >> > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Tue Jun 22 07:20:17 2010 From: showard314 at gmail.com (Scott Howard) Date: Tue, 22 Jun 2010 09:20:17 -0400 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails Message-ID: This is forwarded from: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472053 by Jan Niehusmann I tried putting this on the bug tracker but I couldn't get access In the static initializer of gnu.io.RXTXPort, an exception when initializing the static variable 'z' is silently discarded: try { z = new Zystem(); } catch ( Exception e ) {}; This leads to NullPointerExceptions later, which are difficult to debug as the original exception is lost. I did change the code to try { z = new Zystem(); } catch ( Exception e ) { throw new Error(e.toString()); }; for debugging. Probably a more specific exception would be more appropriate, but the point is that leaving z undefined without reporting an error makes debugging unnecessarily difficult. Thanks. From g3vbv at blueyonder.co.uk Tue Jun 22 19:20:11 2010 From: g3vbv at blueyonder.co.uk (Sid Boyce) Date: Wed, 23 Jun 2010 02:20:11 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar Message-ID: <4C21614B.3060504@blueyonder.co.uk> I am using openSUSE 11.3 RC1. "rfcomm -a" lists no devices From dmesg =========== [288811.093151] usb 2-4.4.2: new full speed USB device using ehci_hcd and address 16 [288811.207421] usb 2-4.4.2: New USB device found, idVendor=0403, idProduct=6001 [288811.207431] usb 2-4.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [288811.207438] usb 2-4.4.2: Product: FT232R USB UART [288811.207443] usb 2-4.4.2: Manufacturer: FTDI [288811.207447] usb 2-4.4.2: SerialNumber: A100efz7 [288811.210509] ftdi_sio 2-4.4.2:1.0: FTDI USB Serial Device converter detected [288811.210534] usb 2-4.4.2: Detected FT232RL [288811.210536] usb 2-4.4.2: Number of endpoints 2 [288811.210538] usb 2-4.4.2: Endpoint 1 MaxPacketSize 64 [288811.210540] usb 2-4.4.2: Endpoint 2 MaxPacketSize 64 [288811.210541] usb 2-4.4.2: Setting MaxPacketSize 64 [288811.210822] usb 2-4.4.2: FTDI USB Serial Device converter now attached to ttyUSB1 Package built and installed OK in /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/amd64, it also installed /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/RXTXcomm.jar slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar RXTXcomm.jar Failed to load Main-Class manifest attribute from RXTXcomm.jar # rpm -qa |grep java java-1_6_0-sun-1.6.0.u20-1.15.x86_64 gcc44-java-4.4.2_20100116-1.2.x86_64 netbeans-javaparser-6.8-1.1.noarch gcc45-java-4.5.0_20100604-1.1.x86_64 ant-javadoc-1.7.1-11.1.noarch javahelp2-2.0.05-6.28.noarch gcc43-java-4.3.4_20091019-2.25.x86_64 gcc-java-4.5-5.2.x86_64 java-ca-certificates-1-5.1.noarch java-1_6_0-sun-devel-1.6.0.u20-1.15.x86_64 lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> echo $JAVA_HOME /usr/lib64/jvm/java-1.6.0-sun-1.6.0 > l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/amd64/ total 6440 drwxr-xr-x 8 root root 4096 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ drwxr-xr-x 2 root root 23 2010-06-18 16:41 headless/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 jli/ -rw-r--r-- 1 root root 652 2010-04-12 22:00 jvm.cfg -rwxr-xr-x 1 root root 15836 2010-04-12 22:25 libattach.so* -rwxr-xr-x 1 root root 757091 2010-04-12 22:25 libawt.so* -rwxr-xr-x 1 root root 413267 2010-04-12 22:25 libcmm.so* -rwxr-xr-x 1 root root 217736 2010-04-12 22:25 libdcpr.so* -rwxr-xr-x 1 root root 120029 2010-04-12 22:30 libdeploy.so* -rwxr-xr-x 1 root root 21670 2010-04-12 22:25 libdt_socket.so* -rwxr-xr-x 1 root root 692649 2010-04-12 22:25 libfontmanager.so* -rwxr-xr-x 1 root root 237073 2010-04-12 22:25 libhprof.so* -rwxr-xr-x 1 root root 50085 2010-04-12 22:25 libinstrument.so* -rwxr-xr-x 1 root root 27244 2010-04-12 22:25 libioser12.so* -rwxr-xr-x 1 root root 46723 2010-04-12 22:25 libj2gss.so* -rwxr-xr-x 1 root root 14272 2010-04-12 22:25 libj2pcsc.so* -rwxr-xr-x 1 root root 78017 2010-04-12 22:25 libj2pkcs11.so* -rwxr-xr-x 1 root root 7980 2010-04-12 22:25 libjaas_unix.so* -rwxr-xr-x 1 root root 28919 2010-04-12 22:25 libjava_crw_demo.so* -rwxr-xr-x 1 root root 231135 2010-04-12 22:25 libjava.so* -rwxr-xr-x 1 root root 7099 2010-04-12 22:25 libjawt.so* -rwxr-xr-x 1 root root 293725 2010-04-12 22:25 libjdwp.so* -rwxr-xr-x 1 root root 224947 2010-04-12 22:25 libjpeg.so* -rwxr-xr-x 1 root root 10964 2010-04-12 22:25 libjsig.so* -rwxr-xr-x 1 root root 260521 2010-04-12 22:25 libjsound.so* -rwxr-xr-x 1 root root 37449 2010-04-12 22:25 libmanagement.so* -rwxr-xr-x 1 root root 734280 2010-04-12 22:25 libmlib_image.so* -rwxr-xr-x 1 root root 6667 2010-04-12 22:25 libnative_chmod_g.so* -rwxr-xr-x 1 root root 6571 2010-04-12 22:25 libnative_chmod.so* -rwxr-xr-x 1 root root 111945 2010-04-12 22:25 libnet.so* -rwxr-xr-x 1 root root 43716 2010-04-12 22:25 libnio.so* -rwxr-xr-x 1 root root 15651 2010-04-12 22:25 libnpt.so* -rwxr-xr-x 1 root root 6420 2010-04-12 22:25 librmi.so* -rwxr-xr-x 1 root root 77907 2010-06-18 16:56 librxtxI2C-2.2pre1.so* -rw-r--r-- 1 root root 97530 2010-06-18 16:56 librxtxI2C.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxI2C.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxI2C.so -> librxtxI2C-2.2pre1.so* -rwxr-xr-x 1 root root 55253 2010-06-18 16:56 librxtxParallel-2.2pre1.so* -rw-r--r-- 1 root root 66164 2010-06-18 16:56 librxtxParallel.a -rwxr-xr-x 1 root root 1035 2010-06-18 16:56 librxtxParallel.la* lrwxrwxrwx 1 root root 26 2010-06-18 16:56 librxtxParallel.so -> librxtxParallel-2.2pre1.so* -rwxr-xr-x 1 root root 79049 2010-06-18 16:56 librxtxRaw-2.2pre1.so* -rw-r--r-- 1 root root 100218 2010-06-18 16:56 librxtxRaw.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxRaw.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxRaw.so -> librxtxRaw-2.2pre1.so* -rwxr-xr-x 1 root root 78134 2010-06-18 16:56 librxtxRS485-2.2pre1.so* -rw-r--r-- 1 root root 98662 2010-06-18 16:56 librxtxRS485.a -rwxr-xr-x 1 root root 1014 2010-06-18 16:56 librxtxRS485.la* lrwxrwxrwx 1 root root 23 2010-06-18 16:56 librxtxRS485.so -> librxtxRS485-2.2pre1.so* -rwxr-xr-x 1 root root 192681 2010-06-18 16:56 librxtxSerial-2.2pre1.so* -rw-r--r-- 1 root root 267524 2010-06-18 16:56 librxtxSerial.a -rwxr-xr-x 1 root root 1021 2010-06-18 16:56 librxtxSerial.la* lrwxrwxrwx 1 root root 24 2010-06-18 16:56 librxtxSerial.so -> librxtxSerial-2.2pre1.so* -rwxr-xr-x 1 root root 48036 2010-04-12 22:25 libsaproc.so* -rwxr-xr-x 1 root root 294575 2010-04-12 22:25 libsplashscreen.so* -rwxr-xr-x 1 root root 134786 2010-04-12 22:25 libunpack.so* -rwxr-xr-x 1 root root 66292 2010-04-12 22:25 libverify.so* -rwxr-xr-x 1 root root 91191 2010-04-12 22:25 libzip.so* drwxr-xr-x 2 root root 23 2010-06-18 16:41 motif21/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 native_threads/ drwxr-xr-x 2 root root 56 2010-06-18 16:41 server/ -rw------- 1 root root 0 2010-06-18 16:53 stC2p3qT -rw------- 1 root root 0 2010-06-18 16:53 stJpl8lW -rw------- 1 root root 0 2010-06-18 16:53 stnb1qWY -rw------- 1 root root 0 2010-06-18 16:53 stYjTgRS -rw------- 1 root root 0 2010-06-18 16:53 stZA8aVV drwxr-xr-x 2 root root 23 2010-06-18 16:41 xawt/ lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/ total 1300 drwxr-xr-x 2 root root 125 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ -rw-r--r-- 1 root root 8239 2010-04-12 22:08 dnsns.jar -rw-r--r-- 1 root root 842216 2010-06-10 12:45 localedata.jar -rw-r--r-- 1 root root 429 2010-04-12 22:23 meta-index -rwxr-xr-x 1 root root 61389 2010-06-18 16:56 RXTXcomm.jar* -rw-r--r-- 1 root root 170239 2010-04-12 21:58 sunjce_provider.jar -rw-r--r-- 1 root root 230608 2010-04-12 22:08 sunpkcs11.jar Help appreciated. 73 ... Sid. -- Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support Specialist, Cricket Coach Microsoft Windows Free Zone - Linux used for all Computing Tasks From Kustaa.Nyholm at planmeca.com Tue Jun 22 23:38:46 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 08:38:46 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: Message-ID: > I did change the code to > try { > z = new Zystem(); > } catch ( Exception e ) { > throw new Error(e.toString()); > }; Is there a reason why this could/should not be: > try { > z = new Zystem(); > } catch ( Throwable e ) { > e.printStackTrace(System.err); > }; From msemtd at googlemail.com Wed Jun 23 02:14:25 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:14:25 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar In-Reply-To: <4C21614B.3060504@blueyonder.co.uk> References: <4C21614B.3060504@blueyonder.co.uk> Message-ID: On 23 June 2010 02:20, Sid Boyce wrote: > slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar > RXTXcomm.jar > Failed to load Main-Class manifest attribute from > RXTXcomm.jar > Help appreciated. > 73 ... Sid. Well Sid, it's pretty obvious to me: you're trying to launch a jar that doesn't contain a main(). What exactly are you trying to achieve by running "java -jar RXTXcomm.jar"? Regards, Michael Erskine. From msemtd at googlemail.com Wed Jun 23 02:17:11 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:17:11 +0100 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: On 23 June 2010 06:38, Kustaa Nyholm wrote: > >> I did change the code to >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >> ? ? ? ? ? ? ? ?}; > > Is there a reason why this could/should not be: > > >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >> ? ? ? ? ? ? ? ?}; Or even just let the exception bubble up and kill whatever thread caused the class to load :) I vote for the removal of Zystem BTW! Regards, Michael Erskine. From george.dma at gmail.com Wed Jun 23 02:34:07 2010 From: george.dma at gmail.com (George H) Date: Wed, 23 Jun 2010 11:34:07 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: -- George H george.dma at gmail.com On Wed, Jun 23, 2010 at 11:17 AM, Michael Erskine wrote: > On 23 June 2010 06:38, Kustaa Nyholm wrote: >> >>> I did change the code to >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >>> ? ? ? ? ? ? ? ?}; >> >> Is there a reason why this could/should not be: >> >> >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >>> ? ? ? ? ? ? ? ?}; > > Or even just let the exception bubble up and kill whatever thread > caused the class to load :) > > I vote for the removal of Zystem BTW! > > Regards, > Michael Erskine. I would prefer that an exception is thrown rather than the stack trace be printed. If anyone is using loggers then it would be useful to catch the exception and log it, rather than let it come out in the error stream where no one might look. From Steffen.DETTMER at ingenico.com Wed Jun 23 03:28:45 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 11:28:45 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: <20100623092844.GF20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 08:38 +0300: > > I did change the code to > > try { > > z = new Zystem(); > > } catch ( Exception e ) { > > throw new Error(e.toString()); > > }; > > Is there a reason why this could/should not be: > > > try { > > z = new Zystem(); > > } catch ( Throwable e ) { > > e.printStackTrace(System.err); > > }; Is this intentionally not throwing the exception? Well, then it still would be discarded (althrough not neccesarily silently :)). BTW, I don't think System.err is a good idea. It is `statically initialized'? I think then this means it is unclear who the caller is and who could catch this exception. Wouldn't it be better to store the exception in a member and throw it when needing Zystem (e.g. in new or open)? 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 Kustaa.Nyholm at planmeca.com Wed Jun 23 03:55:30 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 12:55:30 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: >> Is there a reason why this could/should not be: >> >>> try { >>> z = new Zystem(); >>> } catch ( Throwable e ) { >>> e.printStackTrace(System.err); >>> }; > > Is this intentionally not throwing the exception? Well, no, just a hasty reply from my part. > still would be discarded (althrough not neccesarily silently :)). > BTW, I don't think System.err is a good idea. > > It is `statically initialized'? I think then this means it is > unclear who the caller is and who could catch this exception. > Even so re-throwing the exception would make sense so that the application developer has a chance to handle this in whichever way they want. Of course logically this should not then print the stacktrace because that is the responsibility of the application developer. But so many do not handle these cases sensibly so from the application user point of view it is nice to have something on the console to aid in trouble shooting. Have not checked the context in which this happens so that might influence my opinion. > Wouldn't it be better to store the exception in a member and > throw it when needing Zystem (e.g. in new or open) I'm of the fail-fast school of thought so I think it should be reported and re-thrown as it happens, not later. br Kusti From pietro.galassi at gmail.com Wed Jun 23 05:59:29 2010 From: pietro.galassi at gmail.com (Pietro Galassi) Date: Wed, 23 Jun 2010 13:59:29 +0200 Subject: [Rxtx] Resource temporarily unavaible on writeByte() Message-ID: Hi, i have successfully installe RXTX 64bit version from UBUNTO repository. I wrote a simple test program and it shows i have 3 ports avaible on my system: /dev/ttyS1 - Serial /dev/ttyS0 - Serial /dev/lp0 - Parallel but as soon as i try to "writeByte" any data on the parallel port it always gives me: java.io.IOException: Resource temporarily unavaible on writeByte() My simple code is: ... outputStream = parallelPort.getOutputStream() ; System.out.println("Write..."); outputStream.write(88); outputStream.flush(); outputStream.close(); ... int mode = parallelPort.getMode(); gives always 0. Anyone can help pls ? Thanks a lot, Pietro Galassi -------------- next part -------------- An HTML attachment was scrubbed... URL: From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From leo.guimaraes at gmail.com Fri Jun 18 13:29:14 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Fri, 18 Jun 2010 15:29:14 -0400 Subject: [Rxtx] Virtual Port with RXTX Message-ID: Hello everybody, Please, im crazy trying to solve this problem: I created a virtual port in my server to receive data over the ethernet from a serial port in the client machine. Im using socat for that: In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: 192.168.102.41:54321 its working fine for me, accessing the virtual port via CuteCom or any terminal. But i can't access this port via RXTX. The getPortIdentifiers() method returns only the /dev/ttyS0 port. Please guys, could you help me about that? Thank you very much! Leandro Guimar?es -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Fri Jun 18 23:43:50 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 19 Jun 2010 07:43:50 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: Hi, In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: > 192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or any > terminal. But i can't access this port via RXTX. The getPortIdentifiers() > method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock Try to change name of the virtual port. I suppose you are using Linux, so: In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid prefixes for the Linux com ports. Add your prefix there or change your VCP name to match to any predefined prefix there. Regards Mariusz > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Sat Jun 19 08:03:06 2010 From: jredman at ergotech.com (Jim Redman) Date: Sat, 19 Jun 2010 08:03:06 -0600 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: <4C1CCE1A.90201@ergotech.com> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports so: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 or whatever you need for the virtual port. The ports will enumerate in the order give (I don't know whether this is a guaranteed behavior or just the way it happens to be). Jim On 06/18/2010 11:43 PM, Mariusz Dec wrote: > Hi, > > In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > tcp:192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or > any terminal. But i can't access this port via RXTX. The > getPortIdentifiers() method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork > file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > > Try to change name of the virtual port. > > I suppose you are using Linux, so: > > In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > prefixes for the Linux com ports. > Add your prefix there or change your VCP name to match to any predefined > prefix there. > > Regards > Mariusz > > > > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From leo.guimaraes at gmail.com Mon Jun 21 13:23:26 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 16:23:26 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: <4C1CCE1A.90201@ergotech.com> References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hello, Change my virtual port to ttySXX worked fine... But now, im having another problem... I dont know why, but the virtual port is never calling the SerialEvent in the SerialPortEventListenner... using the real Serial port, works fine. But it doesnt work with the virtual port... Somebody have an idea?? Pleasse! Thank you!! Leandro Guimar?es On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: > You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > so: > > > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > > or whatever you need for the virtual port. The ports will enumerate in the > order give (I don't know whether this is a guaranteed behavior or just the > way it happens to be). > > Jim > > > > > On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> Hi, >> >> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave >> tcp:192.168.102.41:54321 >> >> >> its working fine for me, accessing the virtual port via CuteCom or >> any terminal. But i can't access this port via RXTX. The >> getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >> Please guys, could you help me about that? >> >> >> In client machine: socat tcp-l:54321,reuseaddr,fork >> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >> Try to change name of the virtual port. >> >> I suppose you are using Linux, so: >> >> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> prefixes for the Linux com ports. >> Add your prefix there or change your VCP name to match to any predefined >> prefix there. >> >> Regards >> Mariusz >> >> >> >> Thank you very much! >> Leandro Guimar?es >> >> >> _______________________________________________ >> 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 >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > > _______________________________________________ > 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 Mon Jun 21 13:47:13 2010 From: george.dma at gmail.com (George H) Date: Mon, 21 Jun 2010 19:47:13 +0000 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, This might be because it is a virtual port. I used to do testing on usb/serial port and there were some "signals" it would not send me that a real serial port would. Try to see what signals your serial port sends you that the virtual port doesn't. I think there are some serial port sniffers out there where you can intercept the signals. Also would do good if you look at some technical tutorials on how serial port signals work. A good site which I read over many times to try to understand why things are the way they are is http://www.arcelect.com/rs232.htm I hope this gave you some ideas. Good luck -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Hello, > > ?? Change my virtual port to ttySXX worked fine... > > ?? But now, im having another problem... > > ? I dont know why, but the virtual port is never calling the SerialEvent in > the SerialPortEventListenner... using the real Serial port, works fine. But > it doesnt work with the virtual port... > > > ?? Somebody have an idea?? Pleasse! > > Thank you!! > Leandro Guimar?es > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports >> so: >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> the order give (I don't know whether this is a guaranteed behavior or just >> the way it happens to be). >> >> Jim >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >>> >>> Hi, >>> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >>> ? ?tcp:192.168.102.41:54321 >>> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >>> ? ?any terminal. But i can't access this port via RXTX. The >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >>> >>> ? ? ? Please guys, could you help me about that? >>> >>> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >>> >>> Try to change name of the virtual port. >>> >>> I suppose you are using Linux, so: >>> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >>> prefixes for the Linux com ports. >>> Add your prefix there or change your VCP name to match to any predefined >>> prefix there. >>> >>> Regards >>> Mariusz >>> >>> >>> >>> ? ?Thank you very much! >>> ? ?Leandro Guimar?es >>> >>> >>> ? ?_______________________________________________ >>> ? ?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 >> >> -- >> Jim Redman >> (505) 662 5156 x85 >> http://www.ergotech.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From leo.guimaraes at gmail.com Mon Jun 21 14:56:15 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 17:56:15 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Thanks George, Please, do you know what represents a "data available" in RXTX? Wich signal calls the Listener's Notify? Its the last thing that i need to do to finish my project here! Thank you very much! Leandro Guimar?es 2010/6/21 George H > Hi, > > This might be because it is a virtual port. > I used to do testing on usb/serial port and there were some "signals" > it would not send me that a real serial port would. > Try to see what signals your serial port sends you that the virtual > port doesn't. I think there are some serial port sniffers out there > where you can intercept the signals. Also would do good if you look at > some technical tutorials on how serial port signals work. > > A good site which I read over many times to try to understand why > things are the way they are is http://www.arcelect.com/rs232.htm > > I hope this gave you some ideas. > Good luck > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Hello, > > > > Change my virtual port to ttySXX worked fine... > > > > But now, im having another problem... > > > > I dont know why, but the virtual port is never calling the SerialEvent > in > > the SerialPortEventListenner... using the real Serial port, works fine. > But > > it doesnt work with the virtual port... > > > > > > Somebody have an idea?? Pleasse! > > > > Thank you!! > > Leandro Guimar?es > > > > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > wrote: > >> > >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > >> so: > >> > >> > >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> > >> or whatever you need for the virtual port. The ports will enumerate in > >> the order give (I don't know whether this is a guaranteed behavior or > just > >> the way it happens to be). > >> > >> Jim > >> > >> > >> > >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >>> > >>> Hi, > >>> > >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >>> tcp:192.168.102.41:54321 > >>> > >>> its working fine for me, accessing the virtual port via CuteCom or > >>> any terminal. But i can't access this port via RXTX. The > >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >>> > >>> Please guys, could you help me about that? > >>> > >>> > >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >>> > >>> Try to change name of the virtual port. > >>> > >>> I suppose you are using Linux, so: > >>> > >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >>> prefixes for the Linux com ports. > >>> Add your prefix there or change your VCP name to match to any > predefined > >>> prefix there. > >>> > >>> Regards > >>> Mariusz > >>> > >>> > >>> > >>> Thank you very much! > >>> Leandro Guimar?es > >>> > >>> > >>> _______________________________________________ > >>> 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 > >> > >> -- > >> Jim Redman > >> (505) 662 5156 x85 > >> http://www.ergotech.com > >> _______________________________________________ > >> 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 george.dma at gmail.com Mon Jun 21 22:51:50 2010 From: george.dma at gmail.com (George H) Date: Tue, 22 Jun 2010 07:51:50 +0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Did you read the site I posted? If you did you would have figured out which pin signal on the RS232 interface most likely triggers the data available event. It might be pin 2 and it might be pin 3, depends what kind of serial port you have and the cable. Plus i'm no expert on on RS-232 interfaces, I just know that if I have my hardware in front of me, and the source code of rxtx and a rs-232 specifications sheet then I can debug the problem and find out. This is what I believe you should do to get started to find out the "what, where and why" of your problem. -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Thanks George, > > ?? Please, do you know what represents a "data available" in RXTX? Wich > signal calls the Listener's Notify? > > ?? Its the last thing that i need to do to finish my project here! > > Thank you very much! > > Leandro Guimar?es > > > 2010/6/21 George H >> >> Hi, >> >> This might be because it is a virtual port. >> I used to do testing on usb/serial port and there were some "signals" >> it would not send me that a real serial port would. >> Try to see what signals your serial port sends you that the virtual >> port doesn't. I think there are some serial port sniffers out there >> where you can intercept the signals. Also would do good if you look at >> some technical tutorials on how serial port signals work. >> >> A good site which I read over many times to try to understand why >> things are the way they are is http://www.arcelect.com/rs232.htm >> >> I hope this gave you some ideas. >> Good luck >> -- >> George H >> george.dma at gmail.com >> >> >> >> 2010/6/21 Leandro Guimar?es : >> > Hello, >> > >> > ?? Change my virtual port to ttySXX worked fine... >> > >> > ?? But now, im having another problem... >> > >> > ? I dont know why, but the virtual port is never calling the SerialEvent >> > in >> > the SerialPortEventListenner... using the real Serial port, works fine. >> > But >> > it doesnt work with the virtual port... >> > >> > >> > ?? Somebody have an idea?? Pleasse! >> > >> > Thank you!! >> > Leandro Guimar?es >> > >> > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman >> > wrote: >> >> >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of >> >> ports >> >> so: >> >> >> >> >> >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> >> the order give (I don't know whether this is a guaranteed behavior or >> >> just >> >> the way it happens to be). >> >> >> >> Jim >> >> >> >> >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >> >>> >> >>> Hi, >> >>> >> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >> >>> ? ?tcp:192.168.102.41:54321 >> >>> >> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >> >>> ? ?any terminal. But i can't access this port via RXTX. The >> >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >>> >> >>> ? ? ? Please guys, could you help me about that? >> >>> >> >>> >> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >>> >> >>> Try to change name of the virtual port. >> >>> >> >>> I suppose you are using Linux, so: >> >>> >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> >>> prefixes for the Linux com ports. >> >>> Add your prefix there or change your VCP name to match to any >> >>> predefined >> >>> prefix there. >> >>> >> >>> Regards >> >>> Mariusz >> >>> >> >>> >> >>> >> >>> ? ?Thank you very much! >> >>> ? ?Leandro Guimar?es >> >>> >> >>> >> >>> ? ?_______________________________________________ >> >>> ? ?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 >> >> >> >> -- >> >> Jim Redman >> >> (505) 662 5156 x85 >> >> http://www.ergotech.com >> >> _______________________________________________ >> >> Rxtx mailing list >> >> Rxtx at qbang.org >> >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > >> > _______________________________________________ >> > Rxtx mailing list >> > Rxtx at qbang.org >> > http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > > > From mariusz.dec at gmail.com Tue Jun 22 05:32:01 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 22 Jun 2010 13:32:01 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, I am working with virtual ports only. Because of some problems with events I have changed whole idea. I did a thread in Java which is looking for port data in pool. If data comes in, I parse it and than generate an Java exception for the application. This works very good from several months and has an advantage more - is faster than events services. I have published many times an example code. Look for 2009'november thread "RXTX close() problem solved". In this example you can set Exception generation in read thread. There is a lot of "try-catch" loops which prevents system while you disconnect USB as well. For me works very good in Mac/Linux and Windows. Regards Mariusz 2010/6/22 George H > Did you read the site I posted? If you did you would have figured out > which pin signal on the RS232 interface most likely triggers the data > available event. > It might be pin 2 and it might be pin 3, depends what kind of serial > port you have and the cable. > > Plus i'm no expert on on RS-232 interfaces, I just know that if I have > my hardware in front of me, and the source code of rxtx and a rs-232 > specifications sheet then I can debug the problem and find out. This > is what I believe you should do to get started to find out the "what, > where and why" of your problem. > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Thanks George, > > > > Please, do you know what represents a "data available" in RXTX? Wich > > signal calls the Listener's Notify? > > > > Its the last thing that i need to do to finish my project here! > > > > Thank you very much! > > > > Leandro Guimar?es > > > > > > 2010/6/21 George H > >> > >> Hi, > >> > >> This might be because it is a virtual port. > >> I used to do testing on usb/serial port and there were some "signals" > >> it would not send me that a real serial port would. > >> Try to see what signals your serial port sends you that the virtual > >> port doesn't. I think there are some serial port sniffers out there > >> where you can intercept the signals. Also would do good if you look at > >> some technical tutorials on how serial port signals work. > >> > >> A good site which I read over many times to try to understand why > >> things are the way they are is http://www.arcelect.com/rs232.htm > >> > >> I hope this gave you some ideas. > >> Good luck > >> -- > >> George H > >> george.dma at gmail.com > >> > >> > >> > >> 2010/6/21 Leandro Guimar?es : > >> > Hello, > >> > > >> > Change my virtual port to ttySXX worked fine... > >> > > >> > But now, im having another problem... > >> > > >> > I dont know why, but the virtual port is never calling the > SerialEvent > >> > in > >> > the SerialPortEventListenner... using the real Serial port, works > fine. > >> > But > >> > it doesnt work with the virtual port... > >> > > >> > > >> > Somebody have an idea?? Pleasse! > >> > > >> > Thank you!! > >> > Leandro Guimar?es > >> > > >> > > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > >> > wrote: > >> >> > >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of > >> >> ports > >> >> so: > >> >> > >> >> > >> >> > >> >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> >> > >> >> or whatever you need for the virtual port. The ports will enumerate > in > >> >> the order give (I don't know whether this is a guaranteed behavior or > >> >> just > >> >> the way it happens to be). > >> >> > >> >> Jim > >> >> > >> >> > >> >> > >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> >>> > >> >>> Hi, > >> >>> > >> >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >> >>> tcp:192.168.102.41:54321 > >> >>> > >> >>> its working fine for me, accessing the virtual port via CuteCom > or > >> >>> any terminal. But i can't access this port via RXTX. The > >> >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >> >>> > >> >>> Please guys, could you help me about that? > >> >>> > >> >>> > >> >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >> >>> > >> >>> Try to change name of the virtual port. > >> >>> > >> >>> I suppose you are using Linux, so: > >> >>> > >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >> >>> prefixes for the Linux com ports. > >> >>> Add your prefix there or change your VCP name to match to any > >> >>> predefined > >> >>> prefix there. > >> >>> > >> >>> Regards > >> >>> Mariusz > >> >>> > >> >>> > >> >>> > >> >>> Thank you very much! > >> >>> Leandro Guimar?es > >> >>> > >> >>> > >> >>> _______________________________________________ > >> >>> 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 > >> >> > >> >> -- > >> >> Jim Redman > >> >> (505) 662 5156 x85 > >> >> http://www.ergotech.com > >> >> _______________________________________________ > >> >> 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 > >> > > >> > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Tue Jun 22 07:20:17 2010 From: showard314 at gmail.com (Scott Howard) Date: Tue, 22 Jun 2010 09:20:17 -0400 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails Message-ID: This is forwarded from: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472053 by Jan Niehusmann I tried putting this on the bug tracker but I couldn't get access In the static initializer of gnu.io.RXTXPort, an exception when initializing the static variable 'z' is silently discarded: try { z = new Zystem(); } catch ( Exception e ) {}; This leads to NullPointerExceptions later, which are difficult to debug as the original exception is lost. I did change the code to try { z = new Zystem(); } catch ( Exception e ) { throw new Error(e.toString()); }; for debugging. Probably a more specific exception would be more appropriate, but the point is that leaving z undefined without reporting an error makes debugging unnecessarily difficult. Thanks. From g3vbv at blueyonder.co.uk Tue Jun 22 19:20:11 2010 From: g3vbv at blueyonder.co.uk (Sid Boyce) Date: Wed, 23 Jun 2010 02:20:11 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar Message-ID: <4C21614B.3060504@blueyonder.co.uk> I am using openSUSE 11.3 RC1. "rfcomm -a" lists no devices From dmesg =========== [288811.093151] usb 2-4.4.2: new full speed USB device using ehci_hcd and address 16 [288811.207421] usb 2-4.4.2: New USB device found, idVendor=0403, idProduct=6001 [288811.207431] usb 2-4.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [288811.207438] usb 2-4.4.2: Product: FT232R USB UART [288811.207443] usb 2-4.4.2: Manufacturer: FTDI [288811.207447] usb 2-4.4.2: SerialNumber: A100efz7 [288811.210509] ftdi_sio 2-4.4.2:1.0: FTDI USB Serial Device converter detected [288811.210534] usb 2-4.4.2: Detected FT232RL [288811.210536] usb 2-4.4.2: Number of endpoints 2 [288811.210538] usb 2-4.4.2: Endpoint 1 MaxPacketSize 64 [288811.210540] usb 2-4.4.2: Endpoint 2 MaxPacketSize 64 [288811.210541] usb 2-4.4.2: Setting MaxPacketSize 64 [288811.210822] usb 2-4.4.2: FTDI USB Serial Device converter now attached to ttyUSB1 Package built and installed OK in /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/amd64, it also installed /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/RXTXcomm.jar slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar RXTXcomm.jar Failed to load Main-Class manifest attribute from RXTXcomm.jar # rpm -qa |grep java java-1_6_0-sun-1.6.0.u20-1.15.x86_64 gcc44-java-4.4.2_20100116-1.2.x86_64 netbeans-javaparser-6.8-1.1.noarch gcc45-java-4.5.0_20100604-1.1.x86_64 ant-javadoc-1.7.1-11.1.noarch javahelp2-2.0.05-6.28.noarch gcc43-java-4.3.4_20091019-2.25.x86_64 gcc-java-4.5-5.2.x86_64 java-ca-certificates-1-5.1.noarch java-1_6_0-sun-devel-1.6.0.u20-1.15.x86_64 lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> echo $JAVA_HOME /usr/lib64/jvm/java-1.6.0-sun-1.6.0 > l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/amd64/ total 6440 drwxr-xr-x 8 root root 4096 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ drwxr-xr-x 2 root root 23 2010-06-18 16:41 headless/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 jli/ -rw-r--r-- 1 root root 652 2010-04-12 22:00 jvm.cfg -rwxr-xr-x 1 root root 15836 2010-04-12 22:25 libattach.so* -rwxr-xr-x 1 root root 757091 2010-04-12 22:25 libawt.so* -rwxr-xr-x 1 root root 413267 2010-04-12 22:25 libcmm.so* -rwxr-xr-x 1 root root 217736 2010-04-12 22:25 libdcpr.so* -rwxr-xr-x 1 root root 120029 2010-04-12 22:30 libdeploy.so* -rwxr-xr-x 1 root root 21670 2010-04-12 22:25 libdt_socket.so* -rwxr-xr-x 1 root root 692649 2010-04-12 22:25 libfontmanager.so* -rwxr-xr-x 1 root root 237073 2010-04-12 22:25 libhprof.so* -rwxr-xr-x 1 root root 50085 2010-04-12 22:25 libinstrument.so* -rwxr-xr-x 1 root root 27244 2010-04-12 22:25 libioser12.so* -rwxr-xr-x 1 root root 46723 2010-04-12 22:25 libj2gss.so* -rwxr-xr-x 1 root root 14272 2010-04-12 22:25 libj2pcsc.so* -rwxr-xr-x 1 root root 78017 2010-04-12 22:25 libj2pkcs11.so* -rwxr-xr-x 1 root root 7980 2010-04-12 22:25 libjaas_unix.so* -rwxr-xr-x 1 root root 28919 2010-04-12 22:25 libjava_crw_demo.so* -rwxr-xr-x 1 root root 231135 2010-04-12 22:25 libjava.so* -rwxr-xr-x 1 root root 7099 2010-04-12 22:25 libjawt.so* -rwxr-xr-x 1 root root 293725 2010-04-12 22:25 libjdwp.so* -rwxr-xr-x 1 root root 224947 2010-04-12 22:25 libjpeg.so* -rwxr-xr-x 1 root root 10964 2010-04-12 22:25 libjsig.so* -rwxr-xr-x 1 root root 260521 2010-04-12 22:25 libjsound.so* -rwxr-xr-x 1 root root 37449 2010-04-12 22:25 libmanagement.so* -rwxr-xr-x 1 root root 734280 2010-04-12 22:25 libmlib_image.so* -rwxr-xr-x 1 root root 6667 2010-04-12 22:25 libnative_chmod_g.so* -rwxr-xr-x 1 root root 6571 2010-04-12 22:25 libnative_chmod.so* -rwxr-xr-x 1 root root 111945 2010-04-12 22:25 libnet.so* -rwxr-xr-x 1 root root 43716 2010-04-12 22:25 libnio.so* -rwxr-xr-x 1 root root 15651 2010-04-12 22:25 libnpt.so* -rwxr-xr-x 1 root root 6420 2010-04-12 22:25 librmi.so* -rwxr-xr-x 1 root root 77907 2010-06-18 16:56 librxtxI2C-2.2pre1.so* -rw-r--r-- 1 root root 97530 2010-06-18 16:56 librxtxI2C.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxI2C.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxI2C.so -> librxtxI2C-2.2pre1.so* -rwxr-xr-x 1 root root 55253 2010-06-18 16:56 librxtxParallel-2.2pre1.so* -rw-r--r-- 1 root root 66164 2010-06-18 16:56 librxtxParallel.a -rwxr-xr-x 1 root root 1035 2010-06-18 16:56 librxtxParallel.la* lrwxrwxrwx 1 root root 26 2010-06-18 16:56 librxtxParallel.so -> librxtxParallel-2.2pre1.so* -rwxr-xr-x 1 root root 79049 2010-06-18 16:56 librxtxRaw-2.2pre1.so* -rw-r--r-- 1 root root 100218 2010-06-18 16:56 librxtxRaw.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxRaw.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxRaw.so -> librxtxRaw-2.2pre1.so* -rwxr-xr-x 1 root root 78134 2010-06-18 16:56 librxtxRS485-2.2pre1.so* -rw-r--r-- 1 root root 98662 2010-06-18 16:56 librxtxRS485.a -rwxr-xr-x 1 root root 1014 2010-06-18 16:56 librxtxRS485.la* lrwxrwxrwx 1 root root 23 2010-06-18 16:56 librxtxRS485.so -> librxtxRS485-2.2pre1.so* -rwxr-xr-x 1 root root 192681 2010-06-18 16:56 librxtxSerial-2.2pre1.so* -rw-r--r-- 1 root root 267524 2010-06-18 16:56 librxtxSerial.a -rwxr-xr-x 1 root root 1021 2010-06-18 16:56 librxtxSerial.la* lrwxrwxrwx 1 root root 24 2010-06-18 16:56 librxtxSerial.so -> librxtxSerial-2.2pre1.so* -rwxr-xr-x 1 root root 48036 2010-04-12 22:25 libsaproc.so* -rwxr-xr-x 1 root root 294575 2010-04-12 22:25 libsplashscreen.so* -rwxr-xr-x 1 root root 134786 2010-04-12 22:25 libunpack.so* -rwxr-xr-x 1 root root 66292 2010-04-12 22:25 libverify.so* -rwxr-xr-x 1 root root 91191 2010-04-12 22:25 libzip.so* drwxr-xr-x 2 root root 23 2010-06-18 16:41 motif21/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 native_threads/ drwxr-xr-x 2 root root 56 2010-06-18 16:41 server/ -rw------- 1 root root 0 2010-06-18 16:53 stC2p3qT -rw------- 1 root root 0 2010-06-18 16:53 stJpl8lW -rw------- 1 root root 0 2010-06-18 16:53 stnb1qWY -rw------- 1 root root 0 2010-06-18 16:53 stYjTgRS -rw------- 1 root root 0 2010-06-18 16:53 stZA8aVV drwxr-xr-x 2 root root 23 2010-06-18 16:41 xawt/ lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/ total 1300 drwxr-xr-x 2 root root 125 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ -rw-r--r-- 1 root root 8239 2010-04-12 22:08 dnsns.jar -rw-r--r-- 1 root root 842216 2010-06-10 12:45 localedata.jar -rw-r--r-- 1 root root 429 2010-04-12 22:23 meta-index -rwxr-xr-x 1 root root 61389 2010-06-18 16:56 RXTXcomm.jar* -rw-r--r-- 1 root root 170239 2010-04-12 21:58 sunjce_provider.jar -rw-r--r-- 1 root root 230608 2010-04-12 22:08 sunpkcs11.jar Help appreciated. 73 ... Sid. -- Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support Specialist, Cricket Coach Microsoft Windows Free Zone - Linux used for all Computing Tasks From Kustaa.Nyholm at planmeca.com Tue Jun 22 23:38:46 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 08:38:46 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: Message-ID: > I did change the code to > try { > z = new Zystem(); > } catch ( Exception e ) { > throw new Error(e.toString()); > }; Is there a reason why this could/should not be: > try { > z = new Zystem(); > } catch ( Throwable e ) { > e.printStackTrace(System.err); > }; From msemtd at googlemail.com Wed Jun 23 02:14:25 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:14:25 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar In-Reply-To: <4C21614B.3060504@blueyonder.co.uk> References: <4C21614B.3060504@blueyonder.co.uk> Message-ID: On 23 June 2010 02:20, Sid Boyce wrote: > slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar > RXTXcomm.jar > Failed to load Main-Class manifest attribute from > RXTXcomm.jar > Help appreciated. > 73 ... Sid. Well Sid, it's pretty obvious to me: you're trying to launch a jar that doesn't contain a main(). What exactly are you trying to achieve by running "java -jar RXTXcomm.jar"? Regards, Michael Erskine. From msemtd at googlemail.com Wed Jun 23 02:17:11 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:17:11 +0100 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: On 23 June 2010 06:38, Kustaa Nyholm wrote: > >> I did change the code to >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >> ? ? ? ? ? ? ? ?}; > > Is there a reason why this could/should not be: > > >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >> ? ? ? ? ? ? ? ?}; Or even just let the exception bubble up and kill whatever thread caused the class to load :) I vote for the removal of Zystem BTW! Regards, Michael Erskine. From george.dma at gmail.com Wed Jun 23 02:34:07 2010 From: george.dma at gmail.com (George H) Date: Wed, 23 Jun 2010 11:34:07 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: -- George H george.dma at gmail.com On Wed, Jun 23, 2010 at 11:17 AM, Michael Erskine wrote: > On 23 June 2010 06:38, Kustaa Nyholm wrote: >> >>> I did change the code to >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >>> ? ? ? ? ? ? ? ?}; >> >> Is there a reason why this could/should not be: >> >> >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >>> ? ? ? ? ? ? ? ?}; > > Or even just let the exception bubble up and kill whatever thread > caused the class to load :) > > I vote for the removal of Zystem BTW! > > Regards, > Michael Erskine. I would prefer that an exception is thrown rather than the stack trace be printed. If anyone is using loggers then it would be useful to catch the exception and log it, rather than let it come out in the error stream where no one might look. From Steffen.DETTMER at ingenico.com Wed Jun 23 03:28:45 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 11:28:45 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: <20100623092844.GF20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 08:38 +0300: > > I did change the code to > > try { > > z = new Zystem(); > > } catch ( Exception e ) { > > throw new Error(e.toString()); > > }; > > Is there a reason why this could/should not be: > > > try { > > z = new Zystem(); > > } catch ( Throwable e ) { > > e.printStackTrace(System.err); > > }; Is this intentionally not throwing the exception? Well, then it still would be discarded (althrough not neccesarily silently :)). BTW, I don't think System.err is a good idea. It is `statically initialized'? I think then this means it is unclear who the caller is and who could catch this exception. Wouldn't it be better to store the exception in a member and throw it when needing Zystem (e.g. in new or open)? 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 Kustaa.Nyholm at planmeca.com Wed Jun 23 03:55:30 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 12:55:30 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: >> Is there a reason why this could/should not be: >> >>> try { >>> z = new Zystem(); >>> } catch ( Throwable e ) { >>> e.printStackTrace(System.err); >>> }; > > Is this intentionally not throwing the exception? Well, no, just a hasty reply from my part. > still would be discarded (althrough not neccesarily silently :)). > BTW, I don't think System.err is a good idea. > > It is `statically initialized'? I think then this means it is > unclear who the caller is and who could catch this exception. > Even so re-throwing the exception would make sense so that the application developer has a chance to handle this in whichever way they want. Of course logically this should not then print the stacktrace because that is the responsibility of the application developer. But so many do not handle these cases sensibly so from the application user point of view it is nice to have something on the console to aid in trouble shooting. Have not checked the context in which this happens so that might influence my opinion. > Wouldn't it be better to store the exception in a member and > throw it when needing Zystem (e.g. in new or open) I'm of the fail-fast school of thought so I think it should be reported and re-thrown as it happens, not later. br Kusti From pietro.galassi at gmail.com Wed Jun 23 05:59:29 2010 From: pietro.galassi at gmail.com (Pietro Galassi) Date: Wed, 23 Jun 2010 13:59:29 +0200 Subject: [Rxtx] Resource temporarily unavaible on writeByte() Message-ID: Hi, i have successfully installe RXTX 64bit version from UBUNTO repository. I wrote a simple test program and it shows i have 3 ports avaible on my system: /dev/ttyS1 - Serial /dev/ttyS0 - Serial /dev/lp0 - Parallel but as soon as i try to "writeByte" any data on the parallel port it always gives me: java.io.IOException: Resource temporarily unavaible on writeByte() My simple code is: ... outputStream = parallelPort.getOutputStream() ; System.out.println("Write..."); outputStream.write(88); outputStream.flush(); outputStream.close(); ... int mode = parallelPort.getMode(); gives always 0. Anyone can help pls ? Thanks a lot, Pietro Galassi -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Jun 23 10:35:37 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 18:35:37 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: <20100623163536.GI20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 12:55 +0300: > > Wouldn't it be better to store the exception in a member and > > throw it when needing Zystem (e.g. in new or open) > > I'm of the fail-fast school of thought so I think it should be > reported and re-thrown as it happens, not later. Ahh yes, I agree, in general it is much better to fail quick, loud and verbosely, right! However, if this is a static { } block, AFAIK it is not defined when it will be executed (Before application start? Or later, when loading the class later? Or when using it first time?). If the exception would be thrown before main() is called, I think it is difficult to catch it. I think some general global hook must be used to do so. Simpler to handle, if it is thrown when invocating some function, then it can be caught by try { } catch. (or am I wrong or outdated?) 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 rbreznak at neuronrobotics.com Wed Jun 23 11:46:21 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Wed, 23 Jun 2010 13:46:21 -0400 Subject: [Rxtx] Bundling native libraries Message-ID: Hello, I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. Has anyone had experience in doing this? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Wed Jun 23 18:26:17 2010 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 23 Jun 2010 17:26:17 -0700 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Whoops, forgot to copy this to the RXTX list ... ---------- Forwarded message ---------- From: Brian Schlining Date: Wed, Jun 23, 2010 at 11:11 Subject: Re: [Rxtx] Bundling native libraries To: "Breznak, Robert" Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a > one jar. Its to the point where I have an Ant script that pulls all of the > jars together, but I haven't been able to get the native libraries to work; > They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the > user to get and use. They don't need to worry about external dependencies > and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 24 00:37:35 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 24 Jun 2010 08:37:35 +0200 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Here is a snippet from my ant file. I actually unjar the rxtx jar file and add my own classes to it for Mac and WIndows. The snippet below is actually for Mac but just for your info I am using nsis and launch4j to create an exectuable for windows. I also copy the rxtx libs to the root folder of my application: On 24.06.2010, at 02:26, Brian Schlining wrote: > Whoops, forgot to copy this to the RXTX list ... > > ---------- Forwarded message ---------- > From: Brian Schlining > Date: Wed, Jun 23, 2010 at 11:11 > Subject: Re: [Rxtx] Bundling native libraries > To: "Breznak, Robert" > > > Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc > > On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at -------------- next part -------------- An HTML attachment was scrubbed... URL: From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From leo.guimaraes at gmail.com Fri Jun 18 13:29:14 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Fri, 18 Jun 2010 15:29:14 -0400 Subject: [Rxtx] Virtual Port with RXTX Message-ID: Hello everybody, Please, im crazy trying to solve this problem: I created a virtual port in my server to receive data over the ethernet from a serial port in the client machine. Im using socat for that: In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: 192.168.102.41:54321 its working fine for me, accessing the virtual port via CuteCom or any terminal. But i can't access this port via RXTX. The getPortIdentifiers() method returns only the /dev/ttyS0 port. Please guys, could you help me about that? Thank you very much! Leandro Guimar?es -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Fri Jun 18 23:43:50 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 19 Jun 2010 07:43:50 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: Hi, In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: > 192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or any > terminal. But i can't access this port via RXTX. The getPortIdentifiers() > method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock Try to change name of the virtual port. I suppose you are using Linux, so: In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid prefixes for the Linux com ports. Add your prefix there or change your VCP name to match to any predefined prefix there. Regards Mariusz > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Sat Jun 19 08:03:06 2010 From: jredman at ergotech.com (Jim Redman) Date: Sat, 19 Jun 2010 08:03:06 -0600 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: <4C1CCE1A.90201@ergotech.com> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports so: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 or whatever you need for the virtual port. The ports will enumerate in the order give (I don't know whether this is a guaranteed behavior or just the way it happens to be). Jim On 06/18/2010 11:43 PM, Mariusz Dec wrote: > Hi, > > In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > tcp:192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or > any terminal. But i can't access this port via RXTX. The > getPortIdentifiers() method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork > file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > > Try to change name of the virtual port. > > I suppose you are using Linux, so: > > In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > prefixes for the Linux com ports. > Add your prefix there or change your VCP name to match to any predefined > prefix there. > > Regards > Mariusz > > > > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From leo.guimaraes at gmail.com Mon Jun 21 13:23:26 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 16:23:26 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: <4C1CCE1A.90201@ergotech.com> References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hello, Change my virtual port to ttySXX worked fine... But now, im having another problem... I dont know why, but the virtual port is never calling the SerialEvent in the SerialPortEventListenner... using the real Serial port, works fine. But it doesnt work with the virtual port... Somebody have an idea?? Pleasse! Thank you!! Leandro Guimar?es On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: > You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > so: > > > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > > or whatever you need for the virtual port. The ports will enumerate in the > order give (I don't know whether this is a guaranteed behavior or just the > way it happens to be). > > Jim > > > > > On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> Hi, >> >> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave >> tcp:192.168.102.41:54321 >> >> >> its working fine for me, accessing the virtual port via CuteCom or >> any terminal. But i can't access this port via RXTX. The >> getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >> Please guys, could you help me about that? >> >> >> In client machine: socat tcp-l:54321,reuseaddr,fork >> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >> Try to change name of the virtual port. >> >> I suppose you are using Linux, so: >> >> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> prefixes for the Linux com ports. >> Add your prefix there or change your VCP name to match to any predefined >> prefix there. >> >> Regards >> Mariusz >> >> >> >> Thank you very much! >> Leandro Guimar?es >> >> >> _______________________________________________ >> 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 >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > > _______________________________________________ > 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 Mon Jun 21 13:47:13 2010 From: george.dma at gmail.com (George H) Date: Mon, 21 Jun 2010 19:47:13 +0000 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, This might be because it is a virtual port. I used to do testing on usb/serial port and there were some "signals" it would not send me that a real serial port would. Try to see what signals your serial port sends you that the virtual port doesn't. I think there are some serial port sniffers out there where you can intercept the signals. Also would do good if you look at some technical tutorials on how serial port signals work. A good site which I read over many times to try to understand why things are the way they are is http://www.arcelect.com/rs232.htm I hope this gave you some ideas. Good luck -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Hello, > > ?? Change my virtual port to ttySXX worked fine... > > ?? But now, im having another problem... > > ? I dont know why, but the virtual port is never calling the SerialEvent in > the SerialPortEventListenner... using the real Serial port, works fine. But > it doesnt work with the virtual port... > > > ?? Somebody have an idea?? Pleasse! > > Thank you!! > Leandro Guimar?es > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports >> so: >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> the order give (I don't know whether this is a guaranteed behavior or just >> the way it happens to be). >> >> Jim >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >>> >>> Hi, >>> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >>> ? ?tcp:192.168.102.41:54321 >>> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >>> ? ?any terminal. But i can't access this port via RXTX. The >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >>> >>> ? ? ? Please guys, could you help me about that? >>> >>> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >>> >>> Try to change name of the virtual port. >>> >>> I suppose you are using Linux, so: >>> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >>> prefixes for the Linux com ports. >>> Add your prefix there or change your VCP name to match to any predefined >>> prefix there. >>> >>> Regards >>> Mariusz >>> >>> >>> >>> ? ?Thank you very much! >>> ? ?Leandro Guimar?es >>> >>> >>> ? ?_______________________________________________ >>> ? ?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 >> >> -- >> Jim Redman >> (505) 662 5156 x85 >> http://www.ergotech.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From leo.guimaraes at gmail.com Mon Jun 21 14:56:15 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 17:56:15 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Thanks George, Please, do you know what represents a "data available" in RXTX? Wich signal calls the Listener's Notify? Its the last thing that i need to do to finish my project here! Thank you very much! Leandro Guimar?es 2010/6/21 George H > Hi, > > This might be because it is a virtual port. > I used to do testing on usb/serial port and there were some "signals" > it would not send me that a real serial port would. > Try to see what signals your serial port sends you that the virtual > port doesn't. I think there are some serial port sniffers out there > where you can intercept the signals. Also would do good if you look at > some technical tutorials on how serial port signals work. > > A good site which I read over many times to try to understand why > things are the way they are is http://www.arcelect.com/rs232.htm > > I hope this gave you some ideas. > Good luck > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Hello, > > > > Change my virtual port to ttySXX worked fine... > > > > But now, im having another problem... > > > > I dont know why, but the virtual port is never calling the SerialEvent > in > > the SerialPortEventListenner... using the real Serial port, works fine. > But > > it doesnt work with the virtual port... > > > > > > Somebody have an idea?? Pleasse! > > > > Thank you!! > > Leandro Guimar?es > > > > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > wrote: > >> > >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > >> so: > >> > >> > >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> > >> or whatever you need for the virtual port. The ports will enumerate in > >> the order give (I don't know whether this is a guaranteed behavior or > just > >> the way it happens to be). > >> > >> Jim > >> > >> > >> > >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >>> > >>> Hi, > >>> > >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >>> tcp:192.168.102.41:54321 > >>> > >>> its working fine for me, accessing the virtual port via CuteCom or > >>> any terminal. But i can't access this port via RXTX. The > >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >>> > >>> Please guys, could you help me about that? > >>> > >>> > >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >>> > >>> Try to change name of the virtual port. > >>> > >>> I suppose you are using Linux, so: > >>> > >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >>> prefixes for the Linux com ports. > >>> Add your prefix there or change your VCP name to match to any > predefined > >>> prefix there. > >>> > >>> Regards > >>> Mariusz > >>> > >>> > >>> > >>> Thank you very much! > >>> Leandro Guimar?es > >>> > >>> > >>> _______________________________________________ > >>> 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 > >> > >> -- > >> Jim Redman > >> (505) 662 5156 x85 > >> http://www.ergotech.com > >> _______________________________________________ > >> 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 george.dma at gmail.com Mon Jun 21 22:51:50 2010 From: george.dma at gmail.com (George H) Date: Tue, 22 Jun 2010 07:51:50 +0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Did you read the site I posted? If you did you would have figured out which pin signal on the RS232 interface most likely triggers the data available event. It might be pin 2 and it might be pin 3, depends what kind of serial port you have and the cable. Plus i'm no expert on on RS-232 interfaces, I just know that if I have my hardware in front of me, and the source code of rxtx and a rs-232 specifications sheet then I can debug the problem and find out. This is what I believe you should do to get started to find out the "what, where and why" of your problem. -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Thanks George, > > ?? Please, do you know what represents a "data available" in RXTX? Wich > signal calls the Listener's Notify? > > ?? Its the last thing that i need to do to finish my project here! > > Thank you very much! > > Leandro Guimar?es > > > 2010/6/21 George H >> >> Hi, >> >> This might be because it is a virtual port. >> I used to do testing on usb/serial port and there were some "signals" >> it would not send me that a real serial port would. >> Try to see what signals your serial port sends you that the virtual >> port doesn't. I think there are some serial port sniffers out there >> where you can intercept the signals. Also would do good if you look at >> some technical tutorials on how serial port signals work. >> >> A good site which I read over many times to try to understand why >> things are the way they are is http://www.arcelect.com/rs232.htm >> >> I hope this gave you some ideas. >> Good luck >> -- >> George H >> george.dma at gmail.com >> >> >> >> 2010/6/21 Leandro Guimar?es : >> > Hello, >> > >> > ?? Change my virtual port to ttySXX worked fine... >> > >> > ?? But now, im having another problem... >> > >> > ? I dont know why, but the virtual port is never calling the SerialEvent >> > in >> > the SerialPortEventListenner... using the real Serial port, works fine. >> > But >> > it doesnt work with the virtual port... >> > >> > >> > ?? Somebody have an idea?? Pleasse! >> > >> > Thank you!! >> > Leandro Guimar?es >> > >> > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman >> > wrote: >> >> >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of >> >> ports >> >> so: >> >> >> >> >> >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> >> the order give (I don't know whether this is a guaranteed behavior or >> >> just >> >> the way it happens to be). >> >> >> >> Jim >> >> >> >> >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >> >>> >> >>> Hi, >> >>> >> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >> >>> ? ?tcp:192.168.102.41:54321 >> >>> >> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >> >>> ? ?any terminal. But i can't access this port via RXTX. The >> >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >>> >> >>> ? ? ? Please guys, could you help me about that? >> >>> >> >>> >> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >>> >> >>> Try to change name of the virtual port. >> >>> >> >>> I suppose you are using Linux, so: >> >>> >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> >>> prefixes for the Linux com ports. >> >>> Add your prefix there or change your VCP name to match to any >> >>> predefined >> >>> prefix there. >> >>> >> >>> Regards >> >>> Mariusz >> >>> >> >>> >> >>> >> >>> ? ?Thank you very much! >> >>> ? ?Leandro Guimar?es >> >>> >> >>> >> >>> ? ?_______________________________________________ >> >>> ? ?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 >> >> >> >> -- >> >> Jim Redman >> >> (505) 662 5156 x85 >> >> http://www.ergotech.com >> >> _______________________________________________ >> >> Rxtx mailing list >> >> Rxtx at qbang.org >> >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > >> > _______________________________________________ >> > Rxtx mailing list >> > Rxtx at qbang.org >> > http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > > > From mariusz.dec at gmail.com Tue Jun 22 05:32:01 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 22 Jun 2010 13:32:01 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, I am working with virtual ports only. Because of some problems with events I have changed whole idea. I did a thread in Java which is looking for port data in pool. If data comes in, I parse it and than generate an Java exception for the application. This works very good from several months and has an advantage more - is faster than events services. I have published many times an example code. Look for 2009'november thread "RXTX close() problem solved". In this example you can set Exception generation in read thread. There is a lot of "try-catch" loops which prevents system while you disconnect USB as well. For me works very good in Mac/Linux and Windows. Regards Mariusz 2010/6/22 George H > Did you read the site I posted? If you did you would have figured out > which pin signal on the RS232 interface most likely triggers the data > available event. > It might be pin 2 and it might be pin 3, depends what kind of serial > port you have and the cable. > > Plus i'm no expert on on RS-232 interfaces, I just know that if I have > my hardware in front of me, and the source code of rxtx and a rs-232 > specifications sheet then I can debug the problem and find out. This > is what I believe you should do to get started to find out the "what, > where and why" of your problem. > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Thanks George, > > > > Please, do you know what represents a "data available" in RXTX? Wich > > signal calls the Listener's Notify? > > > > Its the last thing that i need to do to finish my project here! > > > > Thank you very much! > > > > Leandro Guimar?es > > > > > > 2010/6/21 George H > >> > >> Hi, > >> > >> This might be because it is a virtual port. > >> I used to do testing on usb/serial port and there were some "signals" > >> it would not send me that a real serial port would. > >> Try to see what signals your serial port sends you that the virtual > >> port doesn't. I think there are some serial port sniffers out there > >> where you can intercept the signals. Also would do good if you look at > >> some technical tutorials on how serial port signals work. > >> > >> A good site which I read over many times to try to understand why > >> things are the way they are is http://www.arcelect.com/rs232.htm > >> > >> I hope this gave you some ideas. > >> Good luck > >> -- > >> George H > >> george.dma at gmail.com > >> > >> > >> > >> 2010/6/21 Leandro Guimar?es : > >> > Hello, > >> > > >> > Change my virtual port to ttySXX worked fine... > >> > > >> > But now, im having another problem... > >> > > >> > I dont know why, but the virtual port is never calling the > SerialEvent > >> > in > >> > the SerialPortEventListenner... using the real Serial port, works > fine. > >> > But > >> > it doesnt work with the virtual port... > >> > > >> > > >> > Somebody have an idea?? Pleasse! > >> > > >> > Thank you!! > >> > Leandro Guimar?es > >> > > >> > > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > >> > wrote: > >> >> > >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of > >> >> ports > >> >> so: > >> >> > >> >> > >> >> > >> >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> >> > >> >> or whatever you need for the virtual port. The ports will enumerate > in > >> >> the order give (I don't know whether this is a guaranteed behavior or > >> >> just > >> >> the way it happens to be). > >> >> > >> >> Jim > >> >> > >> >> > >> >> > >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> >>> > >> >>> Hi, > >> >>> > >> >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >> >>> tcp:192.168.102.41:54321 > >> >>> > >> >>> its working fine for me, accessing the virtual port via CuteCom > or > >> >>> any terminal. But i can't access this port via RXTX. The > >> >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >> >>> > >> >>> Please guys, could you help me about that? > >> >>> > >> >>> > >> >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >> >>> > >> >>> Try to change name of the virtual port. > >> >>> > >> >>> I suppose you are using Linux, so: > >> >>> > >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >> >>> prefixes for the Linux com ports. > >> >>> Add your prefix there or change your VCP name to match to any > >> >>> predefined > >> >>> prefix there. > >> >>> > >> >>> Regards > >> >>> Mariusz > >> >>> > >> >>> > >> >>> > >> >>> Thank you very much! > >> >>> Leandro Guimar?es > >> >>> > >> >>> > >> >>> _______________________________________________ > >> >>> 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 > >> >> > >> >> -- > >> >> Jim Redman > >> >> (505) 662 5156 x85 > >> >> http://www.ergotech.com > >> >> _______________________________________________ > >> >> 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 > >> > > >> > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Tue Jun 22 07:20:17 2010 From: showard314 at gmail.com (Scott Howard) Date: Tue, 22 Jun 2010 09:20:17 -0400 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails Message-ID: This is forwarded from: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472053 by Jan Niehusmann I tried putting this on the bug tracker but I couldn't get access In the static initializer of gnu.io.RXTXPort, an exception when initializing the static variable 'z' is silently discarded: try { z = new Zystem(); } catch ( Exception e ) {}; This leads to NullPointerExceptions later, which are difficult to debug as the original exception is lost. I did change the code to try { z = new Zystem(); } catch ( Exception e ) { throw new Error(e.toString()); }; for debugging. Probably a more specific exception would be more appropriate, but the point is that leaving z undefined without reporting an error makes debugging unnecessarily difficult. Thanks. From g3vbv at blueyonder.co.uk Tue Jun 22 19:20:11 2010 From: g3vbv at blueyonder.co.uk (Sid Boyce) Date: Wed, 23 Jun 2010 02:20:11 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar Message-ID: <4C21614B.3060504@blueyonder.co.uk> I am using openSUSE 11.3 RC1. "rfcomm -a" lists no devices From dmesg =========== [288811.093151] usb 2-4.4.2: new full speed USB device using ehci_hcd and address 16 [288811.207421] usb 2-4.4.2: New USB device found, idVendor=0403, idProduct=6001 [288811.207431] usb 2-4.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [288811.207438] usb 2-4.4.2: Product: FT232R USB UART [288811.207443] usb 2-4.4.2: Manufacturer: FTDI [288811.207447] usb 2-4.4.2: SerialNumber: A100efz7 [288811.210509] ftdi_sio 2-4.4.2:1.0: FTDI USB Serial Device converter detected [288811.210534] usb 2-4.4.2: Detected FT232RL [288811.210536] usb 2-4.4.2: Number of endpoints 2 [288811.210538] usb 2-4.4.2: Endpoint 1 MaxPacketSize 64 [288811.210540] usb 2-4.4.2: Endpoint 2 MaxPacketSize 64 [288811.210541] usb 2-4.4.2: Setting MaxPacketSize 64 [288811.210822] usb 2-4.4.2: FTDI USB Serial Device converter now attached to ttyUSB1 Package built and installed OK in /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/amd64, it also installed /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/RXTXcomm.jar slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar RXTXcomm.jar Failed to load Main-Class manifest attribute from RXTXcomm.jar # rpm -qa |grep java java-1_6_0-sun-1.6.0.u20-1.15.x86_64 gcc44-java-4.4.2_20100116-1.2.x86_64 netbeans-javaparser-6.8-1.1.noarch gcc45-java-4.5.0_20100604-1.1.x86_64 ant-javadoc-1.7.1-11.1.noarch javahelp2-2.0.05-6.28.noarch gcc43-java-4.3.4_20091019-2.25.x86_64 gcc-java-4.5-5.2.x86_64 java-ca-certificates-1-5.1.noarch java-1_6_0-sun-devel-1.6.0.u20-1.15.x86_64 lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> echo $JAVA_HOME /usr/lib64/jvm/java-1.6.0-sun-1.6.0 > l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/amd64/ total 6440 drwxr-xr-x 8 root root 4096 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ drwxr-xr-x 2 root root 23 2010-06-18 16:41 headless/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 jli/ -rw-r--r-- 1 root root 652 2010-04-12 22:00 jvm.cfg -rwxr-xr-x 1 root root 15836 2010-04-12 22:25 libattach.so* -rwxr-xr-x 1 root root 757091 2010-04-12 22:25 libawt.so* -rwxr-xr-x 1 root root 413267 2010-04-12 22:25 libcmm.so* -rwxr-xr-x 1 root root 217736 2010-04-12 22:25 libdcpr.so* -rwxr-xr-x 1 root root 120029 2010-04-12 22:30 libdeploy.so* -rwxr-xr-x 1 root root 21670 2010-04-12 22:25 libdt_socket.so* -rwxr-xr-x 1 root root 692649 2010-04-12 22:25 libfontmanager.so* -rwxr-xr-x 1 root root 237073 2010-04-12 22:25 libhprof.so* -rwxr-xr-x 1 root root 50085 2010-04-12 22:25 libinstrument.so* -rwxr-xr-x 1 root root 27244 2010-04-12 22:25 libioser12.so* -rwxr-xr-x 1 root root 46723 2010-04-12 22:25 libj2gss.so* -rwxr-xr-x 1 root root 14272 2010-04-12 22:25 libj2pcsc.so* -rwxr-xr-x 1 root root 78017 2010-04-12 22:25 libj2pkcs11.so* -rwxr-xr-x 1 root root 7980 2010-04-12 22:25 libjaas_unix.so* -rwxr-xr-x 1 root root 28919 2010-04-12 22:25 libjava_crw_demo.so* -rwxr-xr-x 1 root root 231135 2010-04-12 22:25 libjava.so* -rwxr-xr-x 1 root root 7099 2010-04-12 22:25 libjawt.so* -rwxr-xr-x 1 root root 293725 2010-04-12 22:25 libjdwp.so* -rwxr-xr-x 1 root root 224947 2010-04-12 22:25 libjpeg.so* -rwxr-xr-x 1 root root 10964 2010-04-12 22:25 libjsig.so* -rwxr-xr-x 1 root root 260521 2010-04-12 22:25 libjsound.so* -rwxr-xr-x 1 root root 37449 2010-04-12 22:25 libmanagement.so* -rwxr-xr-x 1 root root 734280 2010-04-12 22:25 libmlib_image.so* -rwxr-xr-x 1 root root 6667 2010-04-12 22:25 libnative_chmod_g.so* -rwxr-xr-x 1 root root 6571 2010-04-12 22:25 libnative_chmod.so* -rwxr-xr-x 1 root root 111945 2010-04-12 22:25 libnet.so* -rwxr-xr-x 1 root root 43716 2010-04-12 22:25 libnio.so* -rwxr-xr-x 1 root root 15651 2010-04-12 22:25 libnpt.so* -rwxr-xr-x 1 root root 6420 2010-04-12 22:25 librmi.so* -rwxr-xr-x 1 root root 77907 2010-06-18 16:56 librxtxI2C-2.2pre1.so* -rw-r--r-- 1 root root 97530 2010-06-18 16:56 librxtxI2C.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxI2C.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxI2C.so -> librxtxI2C-2.2pre1.so* -rwxr-xr-x 1 root root 55253 2010-06-18 16:56 librxtxParallel-2.2pre1.so* -rw-r--r-- 1 root root 66164 2010-06-18 16:56 librxtxParallel.a -rwxr-xr-x 1 root root 1035 2010-06-18 16:56 librxtxParallel.la* lrwxrwxrwx 1 root root 26 2010-06-18 16:56 librxtxParallel.so -> librxtxParallel-2.2pre1.so* -rwxr-xr-x 1 root root 79049 2010-06-18 16:56 librxtxRaw-2.2pre1.so* -rw-r--r-- 1 root root 100218 2010-06-18 16:56 librxtxRaw.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxRaw.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxRaw.so -> librxtxRaw-2.2pre1.so* -rwxr-xr-x 1 root root 78134 2010-06-18 16:56 librxtxRS485-2.2pre1.so* -rw-r--r-- 1 root root 98662 2010-06-18 16:56 librxtxRS485.a -rwxr-xr-x 1 root root 1014 2010-06-18 16:56 librxtxRS485.la* lrwxrwxrwx 1 root root 23 2010-06-18 16:56 librxtxRS485.so -> librxtxRS485-2.2pre1.so* -rwxr-xr-x 1 root root 192681 2010-06-18 16:56 librxtxSerial-2.2pre1.so* -rw-r--r-- 1 root root 267524 2010-06-18 16:56 librxtxSerial.a -rwxr-xr-x 1 root root 1021 2010-06-18 16:56 librxtxSerial.la* lrwxrwxrwx 1 root root 24 2010-06-18 16:56 librxtxSerial.so -> librxtxSerial-2.2pre1.so* -rwxr-xr-x 1 root root 48036 2010-04-12 22:25 libsaproc.so* -rwxr-xr-x 1 root root 294575 2010-04-12 22:25 libsplashscreen.so* -rwxr-xr-x 1 root root 134786 2010-04-12 22:25 libunpack.so* -rwxr-xr-x 1 root root 66292 2010-04-12 22:25 libverify.so* -rwxr-xr-x 1 root root 91191 2010-04-12 22:25 libzip.so* drwxr-xr-x 2 root root 23 2010-06-18 16:41 motif21/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 native_threads/ drwxr-xr-x 2 root root 56 2010-06-18 16:41 server/ -rw------- 1 root root 0 2010-06-18 16:53 stC2p3qT -rw------- 1 root root 0 2010-06-18 16:53 stJpl8lW -rw------- 1 root root 0 2010-06-18 16:53 stnb1qWY -rw------- 1 root root 0 2010-06-18 16:53 stYjTgRS -rw------- 1 root root 0 2010-06-18 16:53 stZA8aVV drwxr-xr-x 2 root root 23 2010-06-18 16:41 xawt/ lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/ total 1300 drwxr-xr-x 2 root root 125 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ -rw-r--r-- 1 root root 8239 2010-04-12 22:08 dnsns.jar -rw-r--r-- 1 root root 842216 2010-06-10 12:45 localedata.jar -rw-r--r-- 1 root root 429 2010-04-12 22:23 meta-index -rwxr-xr-x 1 root root 61389 2010-06-18 16:56 RXTXcomm.jar* -rw-r--r-- 1 root root 170239 2010-04-12 21:58 sunjce_provider.jar -rw-r--r-- 1 root root 230608 2010-04-12 22:08 sunpkcs11.jar Help appreciated. 73 ... Sid. -- Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support Specialist, Cricket Coach Microsoft Windows Free Zone - Linux used for all Computing Tasks From Kustaa.Nyholm at planmeca.com Tue Jun 22 23:38:46 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 08:38:46 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: Message-ID: > I did change the code to > try { > z = new Zystem(); > } catch ( Exception e ) { > throw new Error(e.toString()); > }; Is there a reason why this could/should not be: > try { > z = new Zystem(); > } catch ( Throwable e ) { > e.printStackTrace(System.err); > }; From msemtd at googlemail.com Wed Jun 23 02:14:25 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:14:25 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar In-Reply-To: <4C21614B.3060504@blueyonder.co.uk> References: <4C21614B.3060504@blueyonder.co.uk> Message-ID: On 23 June 2010 02:20, Sid Boyce wrote: > slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar > RXTXcomm.jar > Failed to load Main-Class manifest attribute from > RXTXcomm.jar > Help appreciated. > 73 ... Sid. Well Sid, it's pretty obvious to me: you're trying to launch a jar that doesn't contain a main(). What exactly are you trying to achieve by running "java -jar RXTXcomm.jar"? Regards, Michael Erskine. From msemtd at googlemail.com Wed Jun 23 02:17:11 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:17:11 +0100 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: On 23 June 2010 06:38, Kustaa Nyholm wrote: > >> I did change the code to >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >> ? ? ? ? ? ? ? ?}; > > Is there a reason why this could/should not be: > > >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >> ? ? ? ? ? ? ? ?}; Or even just let the exception bubble up and kill whatever thread caused the class to load :) I vote for the removal of Zystem BTW! Regards, Michael Erskine. From george.dma at gmail.com Wed Jun 23 02:34:07 2010 From: george.dma at gmail.com (George H) Date: Wed, 23 Jun 2010 11:34:07 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: -- George H george.dma at gmail.com On Wed, Jun 23, 2010 at 11:17 AM, Michael Erskine wrote: > On 23 June 2010 06:38, Kustaa Nyholm wrote: >> >>> I did change the code to >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >>> ? ? ? ? ? ? ? ?}; >> >> Is there a reason why this could/should not be: >> >> >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >>> ? ? ? ? ? ? ? ?}; > > Or even just let the exception bubble up and kill whatever thread > caused the class to load :) > > I vote for the removal of Zystem BTW! > > Regards, > Michael Erskine. I would prefer that an exception is thrown rather than the stack trace be printed. If anyone is using loggers then it would be useful to catch the exception and log it, rather than let it come out in the error stream where no one might look. From Steffen.DETTMER at ingenico.com Wed Jun 23 03:28:45 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 11:28:45 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: <20100623092844.GF20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 08:38 +0300: > > I did change the code to > > try { > > z = new Zystem(); > > } catch ( Exception e ) { > > throw new Error(e.toString()); > > }; > > Is there a reason why this could/should not be: > > > try { > > z = new Zystem(); > > } catch ( Throwable e ) { > > e.printStackTrace(System.err); > > }; Is this intentionally not throwing the exception? Well, then it still would be discarded (althrough not neccesarily silently :)). BTW, I don't think System.err is a good idea. It is `statically initialized'? I think then this means it is unclear who the caller is and who could catch this exception. Wouldn't it be better to store the exception in a member and throw it when needing Zystem (e.g. in new or open)? 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 Kustaa.Nyholm at planmeca.com Wed Jun 23 03:55:30 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 12:55:30 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: >> Is there a reason why this could/should not be: >> >>> try { >>> z = new Zystem(); >>> } catch ( Throwable e ) { >>> e.printStackTrace(System.err); >>> }; > > Is this intentionally not throwing the exception? Well, no, just a hasty reply from my part. > still would be discarded (althrough not neccesarily silently :)). > BTW, I don't think System.err is a good idea. > > It is `statically initialized'? I think then this means it is > unclear who the caller is and who could catch this exception. > Even so re-throwing the exception would make sense so that the application developer has a chance to handle this in whichever way they want. Of course logically this should not then print the stacktrace because that is the responsibility of the application developer. But so many do not handle these cases sensibly so from the application user point of view it is nice to have something on the console to aid in trouble shooting. Have not checked the context in which this happens so that might influence my opinion. > Wouldn't it be better to store the exception in a member and > throw it when needing Zystem (e.g. in new or open) I'm of the fail-fast school of thought so I think it should be reported and re-thrown as it happens, not later. br Kusti From pietro.galassi at gmail.com Wed Jun 23 05:59:29 2010 From: pietro.galassi at gmail.com (Pietro Galassi) Date: Wed, 23 Jun 2010 13:59:29 +0200 Subject: [Rxtx] Resource temporarily unavaible on writeByte() Message-ID: Hi, i have successfully installe RXTX 64bit version from UBUNTO repository. I wrote a simple test program and it shows i have 3 ports avaible on my system: /dev/ttyS1 - Serial /dev/ttyS0 - Serial /dev/lp0 - Parallel but as soon as i try to "writeByte" any data on the parallel port it always gives me: java.io.IOException: Resource temporarily unavaible on writeByte() My simple code is: ... outputStream = parallelPort.getOutputStream() ; System.out.println("Write..."); outputStream.write(88); outputStream.flush(); outputStream.close(); ... int mode = parallelPort.getMode(); gives always 0. Anyone can help pls ? Thanks a lot, Pietro Galassi -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Jun 23 10:35:37 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 18:35:37 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: <20100623163536.GI20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 12:55 +0300: > > Wouldn't it be better to store the exception in a member and > > throw it when needing Zystem (e.g. in new or open) > > I'm of the fail-fast school of thought so I think it should be > reported and re-thrown as it happens, not later. Ahh yes, I agree, in general it is much better to fail quick, loud and verbosely, right! However, if this is a static { } block, AFAIK it is not defined when it will be executed (Before application start? Or later, when loading the class later? Or when using it first time?). If the exception would be thrown before main() is called, I think it is difficult to catch it. I think some general global hook must be used to do so. Simpler to handle, if it is thrown when invocating some function, then it can be caught by try { } catch. (or am I wrong or outdated?) 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 rbreznak at neuronrobotics.com Wed Jun 23 11:46:21 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Wed, 23 Jun 2010 13:46:21 -0400 Subject: [Rxtx] Bundling native libraries Message-ID: Hello, I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. Has anyone had experience in doing this? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Wed Jun 23 18:26:17 2010 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 23 Jun 2010 17:26:17 -0700 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Whoops, forgot to copy this to the RXTX list ... ---------- Forwarded message ---------- From: Brian Schlining Date: Wed, Jun 23, 2010 at 11:11 Subject: Re: [Rxtx] Bundling native libraries To: "Breznak, Robert" Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a > one jar. Its to the point where I have an Ant script that pulls all of the > jars together, but I haven't been able to get the native libraries to work; > They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the > user to get and use. They don't need to worry about external dependencies > and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 24 00:37:35 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 24 Jun 2010 08:37:35 +0200 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Here is a snippet from my ant file. I actually unjar the rxtx jar file and add my own classes to it for Mac and WIndows. The snippet below is actually for Mac but just for your info I am using nsis and launch4j to create an exectuable for windows. I also copy the rxtx libs to the root folder of my application: On 24.06.2010, at 02:26, Brian Schlining wrote: > Whoops, forgot to copy this to the RXTX list ... > > ---------- Forwarded message ---------- > From: Brian Schlining > Date: Wed, Jun 23, 2010 at 11:11 > Subject: Re: [Rxtx] Bundling native libraries > To: "Breznak, Robert" > > > Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc > > On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 11:29:21 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 12:29:21 -0500 Subject: [Rxtx] Port to RS422? Message-ID: Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jun 24 12:18:10 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:18:10 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Thu Jun 24 12:22:15 2010 From: showard314 at gmail.com (Scott Howard) Date: Thu, 24 Jun 2010 14:22:15 -0400 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, On Thu, Jun 24, 2010 at 1:29 PM, James, David (DJ) (SA-1) wrote: > Has anyone tried porting RxTx to RS422? Don't know for sure but . . . > If not, where is all the C code for the other implementations so that I can > give it a shot? http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code There is a file called "PORTING" in the root of rxtx-devel Also refer to the (outdated) information on: http://users.frii.com/jarvi/rxtx/porting.html which has similar information to the PORTING file (trust the PORTING file in case of conflicts) I attached a copy of that file from the 2.2pre2 release to this email. Also, see the "toy box" section: http://rxtx.qbang.org/wiki/index.php/Download for compiled downloads on other platforms good luck. ~Scott -------------- next part -------------- A non-text attachment was scrubbed... Name: PORTING Type: application/octet-stream Size: 5017 bytes Desc: not available URL: From djjames at drs-ssi.com Thu Jun 24 12:22:52 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 13:22:52 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ 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 Jun 24 12:39:42 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:39:42 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 14:10:41 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 15:10:41 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I agree with the RS422/RS485/RS232 control side being the same. Everything I have read says that this should be so. I did notice that there is a RS485 implementation within RxTx that RS485Port.java states is "Non functional". I was thinking that I could/should use the RS485 code as a basis for the RS422 code, if necessary. But this seems a rash course of action if it doesn't function. I am then trying to debug 2 sets of code, instead of working from a good set to get my "bad" set to work correctly. 1) I don't understand the first question "does your RS422 is voltage interface to RS232?" What is "is voltage"? What is an "is voltage interface"? I apologize for my ignorance about this. I have a "true" RS422 port, +/- 5 volt differential if that is what you mean. There is no cross talk between the RS232 and RS422 that I can detect. I know that the RS422 port works, from the command line I have copied a file to that tty device and see voltage changes on my scope on the transmit+ and transmit- pins. 2) No USB dongles are involved in the "badness". That said, as a test, I have run the target java code on a laptop with a USB to serial dongle and a RS232 to RS422 converter hooked to my RS422 source and the serial communications is great. I know that my messaging code is parsing the messages and that the RxTx RS232 code is getting the correct interrupts for the raw data to build the messages up from the raw data. 3) See 2). When I enumerate the ports on my Linux machine, the RS422 port shows up as a serial port. portList = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier foundPortId = null; while (portList.hasMoreElements()) { portId = (gnu.io.CommPortIdentifier) portList.nextElement(); int portType = portId.getPortType(); System.out.println("Found port " + portId.getName()); System.out.println(" of port type " + portId.getPortType()); if (portType == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { portFound = true; foundPortId = portId; } } } I hope this is the information that you requested. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:40 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Thu Jun 24 16:25:11 2010 From: jredman at ergotech.com (Jim Redman) Date: Thu, 24 Jun 2010 16:25:11 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C23DB47.5070308@ergotech.com> RS485 has a 2-wire, half-duplex mode. In this case you need a mechanism to switch sender and receiver. In many cases, the RS485 port will do this for you. Most RS232<->RS485 converters will also manage the switching in a way that is totally transparent to you. In principle, if you don't have a port that handles switching automatically for you, you could control this switching in software. Realistically, unless you have a long delay between sending and reply generation, say 100ms or more, it would be difficult. With most system, the response comes back very quickly and user level code will be too slow to manage that. I think that RS422 is always 4-wire. From the software standpoint, it, and 4-wire RS422 (and current loop and ...) all look the same. There are some electrical issues with RS422 and RS485 particularly termination. I haven't hooked up 485 or 422 in a while so I don't remember all the details, but if you get it wrong it probably won't work. Jim On 06/24/2010 12:39 PM, Mariusz Dec wrote: > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, > I have a 232 port and everything is wonderful. I set the 422 port > up similarly and see no events firing (except output buffer empty). > I set up a scope on the connector and copy a file to the port > (/dev/ttyS1 in my case) and see output. I do the same through RxTx > and see nothing. If this is a setup problem, I am confused as I set > the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so > that I can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From mariusz.dec at gmail.com Fri Jun 25 01:52:48 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 25 Jun 2010 09:52:48 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, now you are sleeping and I have the next day :) So - "voltage interface" means that you have RS232 interface and voltage level converter to use it as RS422. In such case proper work of the RS232 determines proper work of the RS422 (if hw works). In case you make tests on physically different controllers, there may be a lot of traps more, especially now, when we have milions of USB/RS232 dongles vendors and milions of not-properly-working VCP-drivers. Your sentence: "dongle and a RS232 to RS422 converter hooked to" says that you have one RS232 controller and you are using "voltage interface" named >converter< to connect to external RS422 source. It means that only problem is somewhere on the physical part of the interface. If you are seeing signals on the scope, means that you may send dat ok. if you have checked that your USB-serial dongle works good with events, look for the hw mistakes (wiring etc). If you haven't yet checked if your USB-serial dongle works good with events read this: http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html AND always remember that USB-serial dongle isn't serial COM port, this is VIRTUAL Com Port. And this may make a big difference... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t function. > I am then trying to debug 2 sets of code, instead of working from a good set > to get my ?bad? set to work correctly. > > > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on the > transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is parsing > the messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up as > a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:40 PM > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't > the same ? > > Regards > Mariusz > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Fri Jun 25 01:54:39 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 25 Jun 2010 08:54:39 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: <4C23DB47.5070308@ergotech.com> References: <4C23DB47.5070308@ergotech.com> Message-ID: I'm happily using RXTX to communicate with RS422 devices in 4-wire mode using KK-Systems K2 RS232-RS422/RS485 converters (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). Running at 115200 baud -- no issues at all. Regards, Michael Erskine. From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From leo.guimaraes at gmail.com Fri Jun 18 13:29:14 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Fri, 18 Jun 2010 15:29:14 -0400 Subject: [Rxtx] Virtual Port with RXTX Message-ID: Hello everybody, Please, im crazy trying to solve this problem: I created a virtual port in my server to receive data over the ethernet from a serial port in the client machine. Im using socat for that: In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: 192.168.102.41:54321 its working fine for me, accessing the virtual port via CuteCom or any terminal. But i can't access this port via RXTX. The getPortIdentifiers() method returns only the /dev/ttyS0 port. Please guys, could you help me about that? Thank you very much! Leandro Guimar?es -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Fri Jun 18 23:43:50 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 19 Jun 2010 07:43:50 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: Hi, In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: > 192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or any > terminal. But i can't access this port via RXTX. The getPortIdentifiers() > method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock Try to change name of the virtual port. I suppose you are using Linux, so: In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid prefixes for the Linux com ports. Add your prefix there or change your VCP name to match to any predefined prefix there. Regards Mariusz > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Sat Jun 19 08:03:06 2010 From: jredman at ergotech.com (Jim Redman) Date: Sat, 19 Jun 2010 08:03:06 -0600 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: <4C1CCE1A.90201@ergotech.com> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports so: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 or whatever you need for the virtual port. The ports will enumerate in the order give (I don't know whether this is a guaranteed behavior or just the way it happens to be). Jim On 06/18/2010 11:43 PM, Mariusz Dec wrote: > Hi, > > In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > tcp:192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or > any terminal. But i can't access this port via RXTX. The > getPortIdentifiers() method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork > file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > > Try to change name of the virtual port. > > I suppose you are using Linux, so: > > In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > prefixes for the Linux com ports. > Add your prefix there or change your VCP name to match to any predefined > prefix there. > > Regards > Mariusz > > > > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From leo.guimaraes at gmail.com Mon Jun 21 13:23:26 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 16:23:26 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: <4C1CCE1A.90201@ergotech.com> References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hello, Change my virtual port to ttySXX worked fine... But now, im having another problem... I dont know why, but the virtual port is never calling the SerialEvent in the SerialPortEventListenner... using the real Serial port, works fine. But it doesnt work with the virtual port... Somebody have an idea?? Pleasse! Thank you!! Leandro Guimar?es On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: > You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > so: > > > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > > or whatever you need for the virtual port. The ports will enumerate in the > order give (I don't know whether this is a guaranteed behavior or just the > way it happens to be). > > Jim > > > > > On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> Hi, >> >> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave >> tcp:192.168.102.41:54321 >> >> >> its working fine for me, accessing the virtual port via CuteCom or >> any terminal. But i can't access this port via RXTX. The >> getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >> Please guys, could you help me about that? >> >> >> In client machine: socat tcp-l:54321,reuseaddr,fork >> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >> Try to change name of the virtual port. >> >> I suppose you are using Linux, so: >> >> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> prefixes for the Linux com ports. >> Add your prefix there or change your VCP name to match to any predefined >> prefix there. >> >> Regards >> Mariusz >> >> >> >> Thank you very much! >> Leandro Guimar?es >> >> >> _______________________________________________ >> 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 >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > > _______________________________________________ > 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 Mon Jun 21 13:47:13 2010 From: george.dma at gmail.com (George H) Date: Mon, 21 Jun 2010 19:47:13 +0000 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, This might be because it is a virtual port. I used to do testing on usb/serial port and there were some "signals" it would not send me that a real serial port would. Try to see what signals your serial port sends you that the virtual port doesn't. I think there are some serial port sniffers out there where you can intercept the signals. Also would do good if you look at some technical tutorials on how serial port signals work. A good site which I read over many times to try to understand why things are the way they are is http://www.arcelect.com/rs232.htm I hope this gave you some ideas. Good luck -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Hello, > > ?? Change my virtual port to ttySXX worked fine... > > ?? But now, im having another problem... > > ? I dont know why, but the virtual port is never calling the SerialEvent in > the SerialPortEventListenner... using the real Serial port, works fine. But > it doesnt work with the virtual port... > > > ?? Somebody have an idea?? Pleasse! > > Thank you!! > Leandro Guimar?es > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports >> so: >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> the order give (I don't know whether this is a guaranteed behavior or just >> the way it happens to be). >> >> Jim >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >>> >>> Hi, >>> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >>> ? ?tcp:192.168.102.41:54321 >>> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >>> ? ?any terminal. But i can't access this port via RXTX. The >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >>> >>> ? ? ? Please guys, could you help me about that? >>> >>> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >>> >>> Try to change name of the virtual port. >>> >>> I suppose you are using Linux, so: >>> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >>> prefixes for the Linux com ports. >>> Add your prefix there or change your VCP name to match to any predefined >>> prefix there. >>> >>> Regards >>> Mariusz >>> >>> >>> >>> ? ?Thank you very much! >>> ? ?Leandro Guimar?es >>> >>> >>> ? ?_______________________________________________ >>> ? ?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 >> >> -- >> Jim Redman >> (505) 662 5156 x85 >> http://www.ergotech.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From leo.guimaraes at gmail.com Mon Jun 21 14:56:15 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 17:56:15 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Thanks George, Please, do you know what represents a "data available" in RXTX? Wich signal calls the Listener's Notify? Its the last thing that i need to do to finish my project here! Thank you very much! Leandro Guimar?es 2010/6/21 George H > Hi, > > This might be because it is a virtual port. > I used to do testing on usb/serial port and there were some "signals" > it would not send me that a real serial port would. > Try to see what signals your serial port sends you that the virtual > port doesn't. I think there are some serial port sniffers out there > where you can intercept the signals. Also would do good if you look at > some technical tutorials on how serial port signals work. > > A good site which I read over many times to try to understand why > things are the way they are is http://www.arcelect.com/rs232.htm > > I hope this gave you some ideas. > Good luck > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Hello, > > > > Change my virtual port to ttySXX worked fine... > > > > But now, im having another problem... > > > > I dont know why, but the virtual port is never calling the SerialEvent > in > > the SerialPortEventListenner... using the real Serial port, works fine. > But > > it doesnt work with the virtual port... > > > > > > Somebody have an idea?? Pleasse! > > > > Thank you!! > > Leandro Guimar?es > > > > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > wrote: > >> > >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > >> so: > >> > >> > >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> > >> or whatever you need for the virtual port. The ports will enumerate in > >> the order give (I don't know whether this is a guaranteed behavior or > just > >> the way it happens to be). > >> > >> Jim > >> > >> > >> > >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >>> > >>> Hi, > >>> > >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >>> tcp:192.168.102.41:54321 > >>> > >>> its working fine for me, accessing the virtual port via CuteCom or > >>> any terminal. But i can't access this port via RXTX. The > >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >>> > >>> Please guys, could you help me about that? > >>> > >>> > >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >>> > >>> Try to change name of the virtual port. > >>> > >>> I suppose you are using Linux, so: > >>> > >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >>> prefixes for the Linux com ports. > >>> Add your prefix there or change your VCP name to match to any > predefined > >>> prefix there. > >>> > >>> Regards > >>> Mariusz > >>> > >>> > >>> > >>> Thank you very much! > >>> Leandro Guimar?es > >>> > >>> > >>> _______________________________________________ > >>> 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 > >> > >> -- > >> Jim Redman > >> (505) 662 5156 x85 > >> http://www.ergotech.com > >> _______________________________________________ > >> 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 george.dma at gmail.com Mon Jun 21 22:51:50 2010 From: george.dma at gmail.com (George H) Date: Tue, 22 Jun 2010 07:51:50 +0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Did you read the site I posted? If you did you would have figured out which pin signal on the RS232 interface most likely triggers the data available event. It might be pin 2 and it might be pin 3, depends what kind of serial port you have and the cable. Plus i'm no expert on on RS-232 interfaces, I just know that if I have my hardware in front of me, and the source code of rxtx and a rs-232 specifications sheet then I can debug the problem and find out. This is what I believe you should do to get started to find out the "what, where and why" of your problem. -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Thanks George, > > ?? Please, do you know what represents a "data available" in RXTX? Wich > signal calls the Listener's Notify? > > ?? Its the last thing that i need to do to finish my project here! > > Thank you very much! > > Leandro Guimar?es > > > 2010/6/21 George H >> >> Hi, >> >> This might be because it is a virtual port. >> I used to do testing on usb/serial port and there were some "signals" >> it would not send me that a real serial port would. >> Try to see what signals your serial port sends you that the virtual >> port doesn't. I think there are some serial port sniffers out there >> where you can intercept the signals. Also would do good if you look at >> some technical tutorials on how serial port signals work. >> >> A good site which I read over many times to try to understand why >> things are the way they are is http://www.arcelect.com/rs232.htm >> >> I hope this gave you some ideas. >> Good luck >> -- >> George H >> george.dma at gmail.com >> >> >> >> 2010/6/21 Leandro Guimar?es : >> > Hello, >> > >> > ?? Change my virtual port to ttySXX worked fine... >> > >> > ?? But now, im having another problem... >> > >> > ? I dont know why, but the virtual port is never calling the SerialEvent >> > in >> > the SerialPortEventListenner... using the real Serial port, works fine. >> > But >> > it doesnt work with the virtual port... >> > >> > >> > ?? Somebody have an idea?? Pleasse! >> > >> > Thank you!! >> > Leandro Guimar?es >> > >> > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman >> > wrote: >> >> >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of >> >> ports >> >> so: >> >> >> >> >> >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> >> the order give (I don't know whether this is a guaranteed behavior or >> >> just >> >> the way it happens to be). >> >> >> >> Jim >> >> >> >> >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >> >>> >> >>> Hi, >> >>> >> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >> >>> ? ?tcp:192.168.102.41:54321 >> >>> >> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >> >>> ? ?any terminal. But i can't access this port via RXTX. The >> >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >>> >> >>> ? ? ? Please guys, could you help me about that? >> >>> >> >>> >> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >>> >> >>> Try to change name of the virtual port. >> >>> >> >>> I suppose you are using Linux, so: >> >>> >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> >>> prefixes for the Linux com ports. >> >>> Add your prefix there or change your VCP name to match to any >> >>> predefined >> >>> prefix there. >> >>> >> >>> Regards >> >>> Mariusz >> >>> >> >>> >> >>> >> >>> ? ?Thank you very much! >> >>> ? ?Leandro Guimar?es >> >>> >> >>> >> >>> ? ?_______________________________________________ >> >>> ? ?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 >> >> >> >> -- >> >> Jim Redman >> >> (505) 662 5156 x85 >> >> http://www.ergotech.com >> >> _______________________________________________ >> >> Rxtx mailing list >> >> Rxtx at qbang.org >> >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > >> > _______________________________________________ >> > Rxtx mailing list >> > Rxtx at qbang.org >> > http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > > > From mariusz.dec at gmail.com Tue Jun 22 05:32:01 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 22 Jun 2010 13:32:01 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, I am working with virtual ports only. Because of some problems with events I have changed whole idea. I did a thread in Java which is looking for port data in pool. If data comes in, I parse it and than generate an Java exception for the application. This works very good from several months and has an advantage more - is faster than events services. I have published many times an example code. Look for 2009'november thread "RXTX close() problem solved". In this example you can set Exception generation in read thread. There is a lot of "try-catch" loops which prevents system while you disconnect USB as well. For me works very good in Mac/Linux and Windows. Regards Mariusz 2010/6/22 George H > Did you read the site I posted? If you did you would have figured out > which pin signal on the RS232 interface most likely triggers the data > available event. > It might be pin 2 and it might be pin 3, depends what kind of serial > port you have and the cable. > > Plus i'm no expert on on RS-232 interfaces, I just know that if I have > my hardware in front of me, and the source code of rxtx and a rs-232 > specifications sheet then I can debug the problem and find out. This > is what I believe you should do to get started to find out the "what, > where and why" of your problem. > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Thanks George, > > > > Please, do you know what represents a "data available" in RXTX? Wich > > signal calls the Listener's Notify? > > > > Its the last thing that i need to do to finish my project here! > > > > Thank you very much! > > > > Leandro Guimar?es > > > > > > 2010/6/21 George H > >> > >> Hi, > >> > >> This might be because it is a virtual port. > >> I used to do testing on usb/serial port and there were some "signals" > >> it would not send me that a real serial port would. > >> Try to see what signals your serial port sends you that the virtual > >> port doesn't. I think there are some serial port sniffers out there > >> where you can intercept the signals. Also would do good if you look at > >> some technical tutorials on how serial port signals work. > >> > >> A good site which I read over many times to try to understand why > >> things are the way they are is http://www.arcelect.com/rs232.htm > >> > >> I hope this gave you some ideas. > >> Good luck > >> -- > >> George H > >> george.dma at gmail.com > >> > >> > >> > >> 2010/6/21 Leandro Guimar?es : > >> > Hello, > >> > > >> > Change my virtual port to ttySXX worked fine... > >> > > >> > But now, im having another problem... > >> > > >> > I dont know why, but the virtual port is never calling the > SerialEvent > >> > in > >> > the SerialPortEventListenner... using the real Serial port, works > fine. > >> > But > >> > it doesnt work with the virtual port... > >> > > >> > > >> > Somebody have an idea?? Pleasse! > >> > > >> > Thank you!! > >> > Leandro Guimar?es > >> > > >> > > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > >> > wrote: > >> >> > >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of > >> >> ports > >> >> so: > >> >> > >> >> > >> >> > >> >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> >> > >> >> or whatever you need for the virtual port. The ports will enumerate > in > >> >> the order give (I don't know whether this is a guaranteed behavior or > >> >> just > >> >> the way it happens to be). > >> >> > >> >> Jim > >> >> > >> >> > >> >> > >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> >>> > >> >>> Hi, > >> >>> > >> >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >> >>> tcp:192.168.102.41:54321 > >> >>> > >> >>> its working fine for me, accessing the virtual port via CuteCom > or > >> >>> any terminal. But i can't access this port via RXTX. The > >> >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >> >>> > >> >>> Please guys, could you help me about that? > >> >>> > >> >>> > >> >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >> >>> > >> >>> Try to change name of the virtual port. > >> >>> > >> >>> I suppose you are using Linux, so: > >> >>> > >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >> >>> prefixes for the Linux com ports. > >> >>> Add your prefix there or change your VCP name to match to any > >> >>> predefined > >> >>> prefix there. > >> >>> > >> >>> Regards > >> >>> Mariusz > >> >>> > >> >>> > >> >>> > >> >>> Thank you very much! > >> >>> Leandro Guimar?es > >> >>> > >> >>> > >> >>> _______________________________________________ > >> >>> 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 > >> >> > >> >> -- > >> >> Jim Redman > >> >> (505) 662 5156 x85 > >> >> http://www.ergotech.com > >> >> _______________________________________________ > >> >> 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 > >> > > >> > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Tue Jun 22 07:20:17 2010 From: showard314 at gmail.com (Scott Howard) Date: Tue, 22 Jun 2010 09:20:17 -0400 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails Message-ID: This is forwarded from: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472053 by Jan Niehusmann I tried putting this on the bug tracker but I couldn't get access In the static initializer of gnu.io.RXTXPort, an exception when initializing the static variable 'z' is silently discarded: try { z = new Zystem(); } catch ( Exception e ) {}; This leads to NullPointerExceptions later, which are difficult to debug as the original exception is lost. I did change the code to try { z = new Zystem(); } catch ( Exception e ) { throw new Error(e.toString()); }; for debugging. Probably a more specific exception would be more appropriate, but the point is that leaving z undefined without reporting an error makes debugging unnecessarily difficult. Thanks. From g3vbv at blueyonder.co.uk Tue Jun 22 19:20:11 2010 From: g3vbv at blueyonder.co.uk (Sid Boyce) Date: Wed, 23 Jun 2010 02:20:11 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar Message-ID: <4C21614B.3060504@blueyonder.co.uk> I am using openSUSE 11.3 RC1. "rfcomm -a" lists no devices From dmesg =========== [288811.093151] usb 2-4.4.2: new full speed USB device using ehci_hcd and address 16 [288811.207421] usb 2-4.4.2: New USB device found, idVendor=0403, idProduct=6001 [288811.207431] usb 2-4.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [288811.207438] usb 2-4.4.2: Product: FT232R USB UART [288811.207443] usb 2-4.4.2: Manufacturer: FTDI [288811.207447] usb 2-4.4.2: SerialNumber: A100efz7 [288811.210509] ftdi_sio 2-4.4.2:1.0: FTDI USB Serial Device converter detected [288811.210534] usb 2-4.4.2: Detected FT232RL [288811.210536] usb 2-4.4.2: Number of endpoints 2 [288811.210538] usb 2-4.4.2: Endpoint 1 MaxPacketSize 64 [288811.210540] usb 2-4.4.2: Endpoint 2 MaxPacketSize 64 [288811.210541] usb 2-4.4.2: Setting MaxPacketSize 64 [288811.210822] usb 2-4.4.2: FTDI USB Serial Device converter now attached to ttyUSB1 Package built and installed OK in /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/amd64, it also installed /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/RXTXcomm.jar slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar RXTXcomm.jar Failed to load Main-Class manifest attribute from RXTXcomm.jar # rpm -qa |grep java java-1_6_0-sun-1.6.0.u20-1.15.x86_64 gcc44-java-4.4.2_20100116-1.2.x86_64 netbeans-javaparser-6.8-1.1.noarch gcc45-java-4.5.0_20100604-1.1.x86_64 ant-javadoc-1.7.1-11.1.noarch javahelp2-2.0.05-6.28.noarch gcc43-java-4.3.4_20091019-2.25.x86_64 gcc-java-4.5-5.2.x86_64 java-ca-certificates-1-5.1.noarch java-1_6_0-sun-devel-1.6.0.u20-1.15.x86_64 lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> echo $JAVA_HOME /usr/lib64/jvm/java-1.6.0-sun-1.6.0 > l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/amd64/ total 6440 drwxr-xr-x 8 root root 4096 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ drwxr-xr-x 2 root root 23 2010-06-18 16:41 headless/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 jli/ -rw-r--r-- 1 root root 652 2010-04-12 22:00 jvm.cfg -rwxr-xr-x 1 root root 15836 2010-04-12 22:25 libattach.so* -rwxr-xr-x 1 root root 757091 2010-04-12 22:25 libawt.so* -rwxr-xr-x 1 root root 413267 2010-04-12 22:25 libcmm.so* -rwxr-xr-x 1 root root 217736 2010-04-12 22:25 libdcpr.so* -rwxr-xr-x 1 root root 120029 2010-04-12 22:30 libdeploy.so* -rwxr-xr-x 1 root root 21670 2010-04-12 22:25 libdt_socket.so* -rwxr-xr-x 1 root root 692649 2010-04-12 22:25 libfontmanager.so* -rwxr-xr-x 1 root root 237073 2010-04-12 22:25 libhprof.so* -rwxr-xr-x 1 root root 50085 2010-04-12 22:25 libinstrument.so* -rwxr-xr-x 1 root root 27244 2010-04-12 22:25 libioser12.so* -rwxr-xr-x 1 root root 46723 2010-04-12 22:25 libj2gss.so* -rwxr-xr-x 1 root root 14272 2010-04-12 22:25 libj2pcsc.so* -rwxr-xr-x 1 root root 78017 2010-04-12 22:25 libj2pkcs11.so* -rwxr-xr-x 1 root root 7980 2010-04-12 22:25 libjaas_unix.so* -rwxr-xr-x 1 root root 28919 2010-04-12 22:25 libjava_crw_demo.so* -rwxr-xr-x 1 root root 231135 2010-04-12 22:25 libjava.so* -rwxr-xr-x 1 root root 7099 2010-04-12 22:25 libjawt.so* -rwxr-xr-x 1 root root 293725 2010-04-12 22:25 libjdwp.so* -rwxr-xr-x 1 root root 224947 2010-04-12 22:25 libjpeg.so* -rwxr-xr-x 1 root root 10964 2010-04-12 22:25 libjsig.so* -rwxr-xr-x 1 root root 260521 2010-04-12 22:25 libjsound.so* -rwxr-xr-x 1 root root 37449 2010-04-12 22:25 libmanagement.so* -rwxr-xr-x 1 root root 734280 2010-04-12 22:25 libmlib_image.so* -rwxr-xr-x 1 root root 6667 2010-04-12 22:25 libnative_chmod_g.so* -rwxr-xr-x 1 root root 6571 2010-04-12 22:25 libnative_chmod.so* -rwxr-xr-x 1 root root 111945 2010-04-12 22:25 libnet.so* -rwxr-xr-x 1 root root 43716 2010-04-12 22:25 libnio.so* -rwxr-xr-x 1 root root 15651 2010-04-12 22:25 libnpt.so* -rwxr-xr-x 1 root root 6420 2010-04-12 22:25 librmi.so* -rwxr-xr-x 1 root root 77907 2010-06-18 16:56 librxtxI2C-2.2pre1.so* -rw-r--r-- 1 root root 97530 2010-06-18 16:56 librxtxI2C.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxI2C.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxI2C.so -> librxtxI2C-2.2pre1.so* -rwxr-xr-x 1 root root 55253 2010-06-18 16:56 librxtxParallel-2.2pre1.so* -rw-r--r-- 1 root root 66164 2010-06-18 16:56 librxtxParallel.a -rwxr-xr-x 1 root root 1035 2010-06-18 16:56 librxtxParallel.la* lrwxrwxrwx 1 root root 26 2010-06-18 16:56 librxtxParallel.so -> librxtxParallel-2.2pre1.so* -rwxr-xr-x 1 root root 79049 2010-06-18 16:56 librxtxRaw-2.2pre1.so* -rw-r--r-- 1 root root 100218 2010-06-18 16:56 librxtxRaw.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxRaw.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxRaw.so -> librxtxRaw-2.2pre1.so* -rwxr-xr-x 1 root root 78134 2010-06-18 16:56 librxtxRS485-2.2pre1.so* -rw-r--r-- 1 root root 98662 2010-06-18 16:56 librxtxRS485.a -rwxr-xr-x 1 root root 1014 2010-06-18 16:56 librxtxRS485.la* lrwxrwxrwx 1 root root 23 2010-06-18 16:56 librxtxRS485.so -> librxtxRS485-2.2pre1.so* -rwxr-xr-x 1 root root 192681 2010-06-18 16:56 librxtxSerial-2.2pre1.so* -rw-r--r-- 1 root root 267524 2010-06-18 16:56 librxtxSerial.a -rwxr-xr-x 1 root root 1021 2010-06-18 16:56 librxtxSerial.la* lrwxrwxrwx 1 root root 24 2010-06-18 16:56 librxtxSerial.so -> librxtxSerial-2.2pre1.so* -rwxr-xr-x 1 root root 48036 2010-04-12 22:25 libsaproc.so* -rwxr-xr-x 1 root root 294575 2010-04-12 22:25 libsplashscreen.so* -rwxr-xr-x 1 root root 134786 2010-04-12 22:25 libunpack.so* -rwxr-xr-x 1 root root 66292 2010-04-12 22:25 libverify.so* -rwxr-xr-x 1 root root 91191 2010-04-12 22:25 libzip.so* drwxr-xr-x 2 root root 23 2010-06-18 16:41 motif21/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 native_threads/ drwxr-xr-x 2 root root 56 2010-06-18 16:41 server/ -rw------- 1 root root 0 2010-06-18 16:53 stC2p3qT -rw------- 1 root root 0 2010-06-18 16:53 stJpl8lW -rw------- 1 root root 0 2010-06-18 16:53 stnb1qWY -rw------- 1 root root 0 2010-06-18 16:53 stYjTgRS -rw------- 1 root root 0 2010-06-18 16:53 stZA8aVV drwxr-xr-x 2 root root 23 2010-06-18 16:41 xawt/ lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/ total 1300 drwxr-xr-x 2 root root 125 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ -rw-r--r-- 1 root root 8239 2010-04-12 22:08 dnsns.jar -rw-r--r-- 1 root root 842216 2010-06-10 12:45 localedata.jar -rw-r--r-- 1 root root 429 2010-04-12 22:23 meta-index -rwxr-xr-x 1 root root 61389 2010-06-18 16:56 RXTXcomm.jar* -rw-r--r-- 1 root root 170239 2010-04-12 21:58 sunjce_provider.jar -rw-r--r-- 1 root root 230608 2010-04-12 22:08 sunpkcs11.jar Help appreciated. 73 ... Sid. -- Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support Specialist, Cricket Coach Microsoft Windows Free Zone - Linux used for all Computing Tasks From Kustaa.Nyholm at planmeca.com Tue Jun 22 23:38:46 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 08:38:46 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: Message-ID: > I did change the code to > try { > z = new Zystem(); > } catch ( Exception e ) { > throw new Error(e.toString()); > }; Is there a reason why this could/should not be: > try { > z = new Zystem(); > } catch ( Throwable e ) { > e.printStackTrace(System.err); > }; From msemtd at googlemail.com Wed Jun 23 02:14:25 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:14:25 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar In-Reply-To: <4C21614B.3060504@blueyonder.co.uk> References: <4C21614B.3060504@blueyonder.co.uk> Message-ID: On 23 June 2010 02:20, Sid Boyce wrote: > slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar > RXTXcomm.jar > Failed to load Main-Class manifest attribute from > RXTXcomm.jar > Help appreciated. > 73 ... Sid. Well Sid, it's pretty obvious to me: you're trying to launch a jar that doesn't contain a main(). What exactly are you trying to achieve by running "java -jar RXTXcomm.jar"? Regards, Michael Erskine. From msemtd at googlemail.com Wed Jun 23 02:17:11 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:17:11 +0100 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: On 23 June 2010 06:38, Kustaa Nyholm wrote: > >> I did change the code to >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >> ? ? ? ? ? ? ? ?}; > > Is there a reason why this could/should not be: > > >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >> ? ? ? ? ? ? ? ?}; Or even just let the exception bubble up and kill whatever thread caused the class to load :) I vote for the removal of Zystem BTW! Regards, Michael Erskine. From george.dma at gmail.com Wed Jun 23 02:34:07 2010 From: george.dma at gmail.com (George H) Date: Wed, 23 Jun 2010 11:34:07 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: -- George H george.dma at gmail.com On Wed, Jun 23, 2010 at 11:17 AM, Michael Erskine wrote: > On 23 June 2010 06:38, Kustaa Nyholm wrote: >> >>> I did change the code to >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >>> ? ? ? ? ? ? ? ?}; >> >> Is there a reason why this could/should not be: >> >> >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >>> ? ? ? ? ? ? ? ?}; > > Or even just let the exception bubble up and kill whatever thread > caused the class to load :) > > I vote for the removal of Zystem BTW! > > Regards, > Michael Erskine. I would prefer that an exception is thrown rather than the stack trace be printed. If anyone is using loggers then it would be useful to catch the exception and log it, rather than let it come out in the error stream where no one might look. From Steffen.DETTMER at ingenico.com Wed Jun 23 03:28:45 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 11:28:45 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: <20100623092844.GF20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 08:38 +0300: > > I did change the code to > > try { > > z = new Zystem(); > > } catch ( Exception e ) { > > throw new Error(e.toString()); > > }; > > Is there a reason why this could/should not be: > > > try { > > z = new Zystem(); > > } catch ( Throwable e ) { > > e.printStackTrace(System.err); > > }; Is this intentionally not throwing the exception? Well, then it still would be discarded (althrough not neccesarily silently :)). BTW, I don't think System.err is a good idea. It is `statically initialized'? I think then this means it is unclear who the caller is and who could catch this exception. Wouldn't it be better to store the exception in a member and throw it when needing Zystem (e.g. in new or open)? 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 Kustaa.Nyholm at planmeca.com Wed Jun 23 03:55:30 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 12:55:30 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: >> Is there a reason why this could/should not be: >> >>> try { >>> z = new Zystem(); >>> } catch ( Throwable e ) { >>> e.printStackTrace(System.err); >>> }; > > Is this intentionally not throwing the exception? Well, no, just a hasty reply from my part. > still would be discarded (althrough not neccesarily silently :)). > BTW, I don't think System.err is a good idea. > > It is `statically initialized'? I think then this means it is > unclear who the caller is and who could catch this exception. > Even so re-throwing the exception would make sense so that the application developer has a chance to handle this in whichever way they want. Of course logically this should not then print the stacktrace because that is the responsibility of the application developer. But so many do not handle these cases sensibly so from the application user point of view it is nice to have something on the console to aid in trouble shooting. Have not checked the context in which this happens so that might influence my opinion. > Wouldn't it be better to store the exception in a member and > throw it when needing Zystem (e.g. in new or open) I'm of the fail-fast school of thought so I think it should be reported and re-thrown as it happens, not later. br Kusti From pietro.galassi at gmail.com Wed Jun 23 05:59:29 2010 From: pietro.galassi at gmail.com (Pietro Galassi) Date: Wed, 23 Jun 2010 13:59:29 +0200 Subject: [Rxtx] Resource temporarily unavaible on writeByte() Message-ID: Hi, i have successfully installe RXTX 64bit version from UBUNTO repository. I wrote a simple test program and it shows i have 3 ports avaible on my system: /dev/ttyS1 - Serial /dev/ttyS0 - Serial /dev/lp0 - Parallel but as soon as i try to "writeByte" any data on the parallel port it always gives me: java.io.IOException: Resource temporarily unavaible on writeByte() My simple code is: ... outputStream = parallelPort.getOutputStream() ; System.out.println("Write..."); outputStream.write(88); outputStream.flush(); outputStream.close(); ... int mode = parallelPort.getMode(); gives always 0. Anyone can help pls ? Thanks a lot, Pietro Galassi -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Jun 23 10:35:37 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 18:35:37 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: <20100623163536.GI20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 12:55 +0300: > > Wouldn't it be better to store the exception in a member and > > throw it when needing Zystem (e.g. in new or open) > > I'm of the fail-fast school of thought so I think it should be > reported and re-thrown as it happens, not later. Ahh yes, I agree, in general it is much better to fail quick, loud and verbosely, right! However, if this is a static { } block, AFAIK it is not defined when it will be executed (Before application start? Or later, when loading the class later? Or when using it first time?). If the exception would be thrown before main() is called, I think it is difficult to catch it. I think some general global hook must be used to do so. Simpler to handle, if it is thrown when invocating some function, then it can be caught by try { } catch. (or am I wrong or outdated?) 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 rbreznak at neuronrobotics.com Wed Jun 23 11:46:21 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Wed, 23 Jun 2010 13:46:21 -0400 Subject: [Rxtx] Bundling native libraries Message-ID: Hello, I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. Has anyone had experience in doing this? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Wed Jun 23 18:26:17 2010 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 23 Jun 2010 17:26:17 -0700 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Whoops, forgot to copy this to the RXTX list ... ---------- Forwarded message ---------- From: Brian Schlining Date: Wed, Jun 23, 2010 at 11:11 Subject: Re: [Rxtx] Bundling native libraries To: "Breznak, Robert" Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a > one jar. Its to the point where I have an Ant script that pulls all of the > jars together, but I haven't been able to get the native libraries to work; > They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the > user to get and use. They don't need to worry about external dependencies > and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 24 00:37:35 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 24 Jun 2010 08:37:35 +0200 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Here is a snippet from my ant file. I actually unjar the rxtx jar file and add my own classes to it for Mac and WIndows. The snippet below is actually for Mac but just for your info I am using nsis and launch4j to create an exectuable for windows. I also copy the rxtx libs to the root folder of my application: On 24.06.2010, at 02:26, Brian Schlining wrote: > Whoops, forgot to copy this to the RXTX list ... > > ---------- Forwarded message ---------- > From: Brian Schlining > Date: Wed, Jun 23, 2010 at 11:11 > Subject: Re: [Rxtx] Bundling native libraries > To: "Breznak, Robert" > > > Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc > > On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 11:29:21 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 12:29:21 -0500 Subject: [Rxtx] Port to RS422? Message-ID: Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jun 24 12:18:10 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:18:10 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Thu Jun 24 12:22:15 2010 From: showard314 at gmail.com (Scott Howard) Date: Thu, 24 Jun 2010 14:22:15 -0400 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, On Thu, Jun 24, 2010 at 1:29 PM, James, David (DJ) (SA-1) wrote: > Has anyone tried porting RxTx to RS422? Don't know for sure but . . . > If not, where is all the C code for the other implementations so that I can > give it a shot? http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code There is a file called "PORTING" in the root of rxtx-devel Also refer to the (outdated) information on: http://users.frii.com/jarvi/rxtx/porting.html which has similar information to the PORTING file (trust the PORTING file in case of conflicts) I attached a copy of that file from the 2.2pre2 release to this email. Also, see the "toy box" section: http://rxtx.qbang.org/wiki/index.php/Download for compiled downloads on other platforms good luck. ~Scott -------------- next part -------------- A non-text attachment was scrubbed... Name: PORTING Type: application/octet-stream Size: 5017 bytes Desc: not available URL: From djjames at drs-ssi.com Thu Jun 24 12:22:52 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 13:22:52 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ 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 Jun 24 12:39:42 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:39:42 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 14:10:41 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 15:10:41 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I agree with the RS422/RS485/RS232 control side being the same. Everything I have read says that this should be so. I did notice that there is a RS485 implementation within RxTx that RS485Port.java states is "Non functional". I was thinking that I could/should use the RS485 code as a basis for the RS422 code, if necessary. But this seems a rash course of action if it doesn't function. I am then trying to debug 2 sets of code, instead of working from a good set to get my "bad" set to work correctly. 1) I don't understand the first question "does your RS422 is voltage interface to RS232?" What is "is voltage"? What is an "is voltage interface"? I apologize for my ignorance about this. I have a "true" RS422 port, +/- 5 volt differential if that is what you mean. There is no cross talk between the RS232 and RS422 that I can detect. I know that the RS422 port works, from the command line I have copied a file to that tty device and see voltage changes on my scope on the transmit+ and transmit- pins. 2) No USB dongles are involved in the "badness". That said, as a test, I have run the target java code on a laptop with a USB to serial dongle and a RS232 to RS422 converter hooked to my RS422 source and the serial communications is great. I know that my messaging code is parsing the messages and that the RxTx RS232 code is getting the correct interrupts for the raw data to build the messages up from the raw data. 3) See 2). When I enumerate the ports on my Linux machine, the RS422 port shows up as a serial port. portList = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier foundPortId = null; while (portList.hasMoreElements()) { portId = (gnu.io.CommPortIdentifier) portList.nextElement(); int portType = portId.getPortType(); System.out.println("Found port " + portId.getName()); System.out.println(" of port type " + portId.getPortType()); if (portType == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { portFound = true; foundPortId = portId; } } } I hope this is the information that you requested. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:40 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Thu Jun 24 16:25:11 2010 From: jredman at ergotech.com (Jim Redman) Date: Thu, 24 Jun 2010 16:25:11 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C23DB47.5070308@ergotech.com> RS485 has a 2-wire, half-duplex mode. In this case you need a mechanism to switch sender and receiver. In many cases, the RS485 port will do this for you. Most RS232<->RS485 converters will also manage the switching in a way that is totally transparent to you. In principle, if you don't have a port that handles switching automatically for you, you could control this switching in software. Realistically, unless you have a long delay between sending and reply generation, say 100ms or more, it would be difficult. With most system, the response comes back very quickly and user level code will be too slow to manage that. I think that RS422 is always 4-wire. From the software standpoint, it, and 4-wire RS422 (and current loop and ...) all look the same. There are some electrical issues with RS422 and RS485 particularly termination. I haven't hooked up 485 or 422 in a while so I don't remember all the details, but if you get it wrong it probably won't work. Jim On 06/24/2010 12:39 PM, Mariusz Dec wrote: > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, > I have a 232 port and everything is wonderful. I set the 422 port > up similarly and see no events firing (except output buffer empty). > I set up a scope on the connector and copy a file to the port > (/dev/ttyS1 in my case) and see output. I do the same through RxTx > and see nothing. If this is a setup problem, I am confused as I set > the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so > that I can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From mariusz.dec at gmail.com Fri Jun 25 01:52:48 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 25 Jun 2010 09:52:48 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, now you are sleeping and I have the next day :) So - "voltage interface" means that you have RS232 interface and voltage level converter to use it as RS422. In such case proper work of the RS232 determines proper work of the RS422 (if hw works). In case you make tests on physically different controllers, there may be a lot of traps more, especially now, when we have milions of USB/RS232 dongles vendors and milions of not-properly-working VCP-drivers. Your sentence: "dongle and a RS232 to RS422 converter hooked to" says that you have one RS232 controller and you are using "voltage interface" named >converter< to connect to external RS422 source. It means that only problem is somewhere on the physical part of the interface. If you are seeing signals on the scope, means that you may send dat ok. if you have checked that your USB-serial dongle works good with events, look for the hw mistakes (wiring etc). If you haven't yet checked if your USB-serial dongle works good with events read this: http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html AND always remember that USB-serial dongle isn't serial COM port, this is VIRTUAL Com Port. And this may make a big difference... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t function. > I am then trying to debug 2 sets of code, instead of working from a good set > to get my ?bad? set to work correctly. > > > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on the > transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is parsing > the messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up as > a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:40 PM > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't > the same ? > > Regards > Mariusz > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Fri Jun 25 01:54:39 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 25 Jun 2010 08:54:39 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: <4C23DB47.5070308@ergotech.com> References: <4C23DB47.5070308@ergotech.com> Message-ID: I'm happily using RXTX to communicate with RS422 devices in 4-wire mode using KK-Systems K2 RS232-RS422/RS485 converters (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). Running at 115200 baud -- no issues at all. Regards, Michael Erskine. From jredman at ergotech.com Fri Jun 25 11:29:10 2010 From: jredman at ergotech.com (Jim Redman) Date: Fri, 25 Jun 2010 11:29:10 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <4C23DB47.5070308@ergotech.com> Message-ID: <4C24E766.50102@ergotech.com> Note that the K2 doesn't do automatic switching for RS485, the K2-ADE does. For true RS422 this is irrelevant. We've used a bunch of converters, including some USB versions, some from B&B (http://www.bb-elec.com/) and some (a lot?) of the non-name, low cost RS232-RS485 converters that are out there. There really is no difference as far as the software is concerned. The cabling and termination of 485/422 do tend to be more problematic, and it's likely that the problem lies there rather than anywhere else. Jim On 06/25/2010 01:54 AM, Michael Erskine wrote: > I'm happily using RXTX to communicate with RS422 devices in 4-wire > mode using KK-Systems K2 RS232-RS422/RS485 converters > (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). > Running at 115200 baud -- no issues at all. > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From leo.guimaraes at gmail.com Fri Jun 18 13:29:14 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Fri, 18 Jun 2010 15:29:14 -0400 Subject: [Rxtx] Virtual Port with RXTX Message-ID: Hello everybody, Please, im crazy trying to solve this problem: I created a virtual port in my server to receive data over the ethernet from a serial port in the client machine. Im using socat for that: In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: 192.168.102.41:54321 its working fine for me, accessing the virtual port via CuteCom or any terminal. But i can't access this port via RXTX. The getPortIdentifiers() method returns only the /dev/ttyS0 port. Please guys, could you help me about that? Thank you very much! Leandro Guimar?es -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Fri Jun 18 23:43:50 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 19 Jun 2010 07:43:50 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: Hi, In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: > 192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or any > terminal. But i can't access this port via RXTX. The getPortIdentifiers() > method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock Try to change name of the virtual port. I suppose you are using Linux, so: In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid prefixes for the Linux com ports. Add your prefix there or change your VCP name to match to any predefined prefix there. Regards Mariusz > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Sat Jun 19 08:03:06 2010 From: jredman at ergotech.com (Jim Redman) Date: Sat, 19 Jun 2010 08:03:06 -0600 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: <4C1CCE1A.90201@ergotech.com> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports so: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 or whatever you need for the virtual port. The ports will enumerate in the order give (I don't know whether this is a guaranteed behavior or just the way it happens to be). Jim On 06/18/2010 11:43 PM, Mariusz Dec wrote: > Hi, > > In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > tcp:192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or > any terminal. But i can't access this port via RXTX. The > getPortIdentifiers() method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork > file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > > Try to change name of the virtual port. > > I suppose you are using Linux, so: > > In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > prefixes for the Linux com ports. > Add your prefix there or change your VCP name to match to any predefined > prefix there. > > Regards > Mariusz > > > > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From leo.guimaraes at gmail.com Mon Jun 21 13:23:26 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 16:23:26 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: <4C1CCE1A.90201@ergotech.com> References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hello, Change my virtual port to ttySXX worked fine... But now, im having another problem... I dont know why, but the virtual port is never calling the SerialEvent in the SerialPortEventListenner... using the real Serial port, works fine. But it doesnt work with the virtual port... Somebody have an idea?? Pleasse! Thank you!! Leandro Guimar?es On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: > You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > so: > > > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > > or whatever you need for the virtual port. The ports will enumerate in the > order give (I don't know whether this is a guaranteed behavior or just the > way it happens to be). > > Jim > > > > > On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> Hi, >> >> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave >> tcp:192.168.102.41:54321 >> >> >> its working fine for me, accessing the virtual port via CuteCom or >> any terminal. But i can't access this port via RXTX. The >> getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >> Please guys, could you help me about that? >> >> >> In client machine: socat tcp-l:54321,reuseaddr,fork >> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >> Try to change name of the virtual port. >> >> I suppose you are using Linux, so: >> >> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> prefixes for the Linux com ports. >> Add your prefix there or change your VCP name to match to any predefined >> prefix there. >> >> Regards >> Mariusz >> >> >> >> Thank you very much! >> Leandro Guimar?es >> >> >> _______________________________________________ >> 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 >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > > _______________________________________________ > 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 Mon Jun 21 13:47:13 2010 From: george.dma at gmail.com (George H) Date: Mon, 21 Jun 2010 19:47:13 +0000 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, This might be because it is a virtual port. I used to do testing on usb/serial port and there were some "signals" it would not send me that a real serial port would. Try to see what signals your serial port sends you that the virtual port doesn't. I think there are some serial port sniffers out there where you can intercept the signals. Also would do good if you look at some technical tutorials on how serial port signals work. A good site which I read over many times to try to understand why things are the way they are is http://www.arcelect.com/rs232.htm I hope this gave you some ideas. Good luck -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Hello, > > ?? Change my virtual port to ttySXX worked fine... > > ?? But now, im having another problem... > > ? I dont know why, but the virtual port is never calling the SerialEvent in > the SerialPortEventListenner... using the real Serial port, works fine. But > it doesnt work with the virtual port... > > > ?? Somebody have an idea?? Pleasse! > > Thank you!! > Leandro Guimar?es > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports >> so: >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> the order give (I don't know whether this is a guaranteed behavior or just >> the way it happens to be). >> >> Jim >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >>> >>> Hi, >>> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >>> ? ?tcp:192.168.102.41:54321 >>> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >>> ? ?any terminal. But i can't access this port via RXTX. The >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >>> >>> ? ? ? Please guys, could you help me about that? >>> >>> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >>> >>> Try to change name of the virtual port. >>> >>> I suppose you are using Linux, so: >>> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >>> prefixes for the Linux com ports. >>> Add your prefix there or change your VCP name to match to any predefined >>> prefix there. >>> >>> Regards >>> Mariusz >>> >>> >>> >>> ? ?Thank you very much! >>> ? ?Leandro Guimar?es >>> >>> >>> ? ?_______________________________________________ >>> ? ?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 >> >> -- >> Jim Redman >> (505) 662 5156 x85 >> http://www.ergotech.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From leo.guimaraes at gmail.com Mon Jun 21 14:56:15 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 17:56:15 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Thanks George, Please, do you know what represents a "data available" in RXTX? Wich signal calls the Listener's Notify? Its the last thing that i need to do to finish my project here! Thank you very much! Leandro Guimar?es 2010/6/21 George H > Hi, > > This might be because it is a virtual port. > I used to do testing on usb/serial port and there were some "signals" > it would not send me that a real serial port would. > Try to see what signals your serial port sends you that the virtual > port doesn't. I think there are some serial port sniffers out there > where you can intercept the signals. Also would do good if you look at > some technical tutorials on how serial port signals work. > > A good site which I read over many times to try to understand why > things are the way they are is http://www.arcelect.com/rs232.htm > > I hope this gave you some ideas. > Good luck > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Hello, > > > > Change my virtual port to ttySXX worked fine... > > > > But now, im having another problem... > > > > I dont know why, but the virtual port is never calling the SerialEvent > in > > the SerialPortEventListenner... using the real Serial port, works fine. > But > > it doesnt work with the virtual port... > > > > > > Somebody have an idea?? Pleasse! > > > > Thank you!! > > Leandro Guimar?es > > > > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > wrote: > >> > >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > >> so: > >> > >> > >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> > >> or whatever you need for the virtual port. The ports will enumerate in > >> the order give (I don't know whether this is a guaranteed behavior or > just > >> the way it happens to be). > >> > >> Jim > >> > >> > >> > >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >>> > >>> Hi, > >>> > >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >>> tcp:192.168.102.41:54321 > >>> > >>> its working fine for me, accessing the virtual port via CuteCom or > >>> any terminal. But i can't access this port via RXTX. The > >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >>> > >>> Please guys, could you help me about that? > >>> > >>> > >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >>> > >>> Try to change name of the virtual port. > >>> > >>> I suppose you are using Linux, so: > >>> > >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >>> prefixes for the Linux com ports. > >>> Add your prefix there or change your VCP name to match to any > predefined > >>> prefix there. > >>> > >>> Regards > >>> Mariusz > >>> > >>> > >>> > >>> Thank you very much! > >>> Leandro Guimar?es > >>> > >>> > >>> _______________________________________________ > >>> 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 > >> > >> -- > >> Jim Redman > >> (505) 662 5156 x85 > >> http://www.ergotech.com > >> _______________________________________________ > >> 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 george.dma at gmail.com Mon Jun 21 22:51:50 2010 From: george.dma at gmail.com (George H) Date: Tue, 22 Jun 2010 07:51:50 +0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Did you read the site I posted? If you did you would have figured out which pin signal on the RS232 interface most likely triggers the data available event. It might be pin 2 and it might be pin 3, depends what kind of serial port you have and the cable. Plus i'm no expert on on RS-232 interfaces, I just know that if I have my hardware in front of me, and the source code of rxtx and a rs-232 specifications sheet then I can debug the problem and find out. This is what I believe you should do to get started to find out the "what, where and why" of your problem. -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Thanks George, > > ?? Please, do you know what represents a "data available" in RXTX? Wich > signal calls the Listener's Notify? > > ?? Its the last thing that i need to do to finish my project here! > > Thank you very much! > > Leandro Guimar?es > > > 2010/6/21 George H >> >> Hi, >> >> This might be because it is a virtual port. >> I used to do testing on usb/serial port and there were some "signals" >> it would not send me that a real serial port would. >> Try to see what signals your serial port sends you that the virtual >> port doesn't. I think there are some serial port sniffers out there >> where you can intercept the signals. Also would do good if you look at >> some technical tutorials on how serial port signals work. >> >> A good site which I read over many times to try to understand why >> things are the way they are is http://www.arcelect.com/rs232.htm >> >> I hope this gave you some ideas. >> Good luck >> -- >> George H >> george.dma at gmail.com >> >> >> >> 2010/6/21 Leandro Guimar?es : >> > Hello, >> > >> > ?? Change my virtual port to ttySXX worked fine... >> > >> > ?? But now, im having another problem... >> > >> > ? I dont know why, but the virtual port is never calling the SerialEvent >> > in >> > the SerialPortEventListenner... using the real Serial port, works fine. >> > But >> > it doesnt work with the virtual port... >> > >> > >> > ?? Somebody have an idea?? Pleasse! >> > >> > Thank you!! >> > Leandro Guimar?es >> > >> > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman >> > wrote: >> >> >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of >> >> ports >> >> so: >> >> >> >> >> >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> >> the order give (I don't know whether this is a guaranteed behavior or >> >> just >> >> the way it happens to be). >> >> >> >> Jim >> >> >> >> >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >> >>> >> >>> Hi, >> >>> >> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >> >>> ? ?tcp:192.168.102.41:54321 >> >>> >> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >> >>> ? ?any terminal. But i can't access this port via RXTX. The >> >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >>> >> >>> ? ? ? Please guys, could you help me about that? >> >>> >> >>> >> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >>> >> >>> Try to change name of the virtual port. >> >>> >> >>> I suppose you are using Linux, so: >> >>> >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> >>> prefixes for the Linux com ports. >> >>> Add your prefix there or change your VCP name to match to any >> >>> predefined >> >>> prefix there. >> >>> >> >>> Regards >> >>> Mariusz >> >>> >> >>> >> >>> >> >>> ? ?Thank you very much! >> >>> ? ?Leandro Guimar?es >> >>> >> >>> >> >>> ? ?_______________________________________________ >> >>> ? ?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 >> >> >> >> -- >> >> Jim Redman >> >> (505) 662 5156 x85 >> >> http://www.ergotech.com >> >> _______________________________________________ >> >> Rxtx mailing list >> >> Rxtx at qbang.org >> >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > >> > _______________________________________________ >> > Rxtx mailing list >> > Rxtx at qbang.org >> > http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > > > From mariusz.dec at gmail.com Tue Jun 22 05:32:01 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 22 Jun 2010 13:32:01 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, I am working with virtual ports only. Because of some problems with events I have changed whole idea. I did a thread in Java which is looking for port data in pool. If data comes in, I parse it and than generate an Java exception for the application. This works very good from several months and has an advantage more - is faster than events services. I have published many times an example code. Look for 2009'november thread "RXTX close() problem solved". In this example you can set Exception generation in read thread. There is a lot of "try-catch" loops which prevents system while you disconnect USB as well. For me works very good in Mac/Linux and Windows. Regards Mariusz 2010/6/22 George H > Did you read the site I posted? If you did you would have figured out > which pin signal on the RS232 interface most likely triggers the data > available event. > It might be pin 2 and it might be pin 3, depends what kind of serial > port you have and the cable. > > Plus i'm no expert on on RS-232 interfaces, I just know that if I have > my hardware in front of me, and the source code of rxtx and a rs-232 > specifications sheet then I can debug the problem and find out. This > is what I believe you should do to get started to find out the "what, > where and why" of your problem. > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Thanks George, > > > > Please, do you know what represents a "data available" in RXTX? Wich > > signal calls the Listener's Notify? > > > > Its the last thing that i need to do to finish my project here! > > > > Thank you very much! > > > > Leandro Guimar?es > > > > > > 2010/6/21 George H > >> > >> Hi, > >> > >> This might be because it is a virtual port. > >> I used to do testing on usb/serial port and there were some "signals" > >> it would not send me that a real serial port would. > >> Try to see what signals your serial port sends you that the virtual > >> port doesn't. I think there are some serial port sniffers out there > >> where you can intercept the signals. Also would do good if you look at > >> some technical tutorials on how serial port signals work. > >> > >> A good site which I read over many times to try to understand why > >> things are the way they are is http://www.arcelect.com/rs232.htm > >> > >> I hope this gave you some ideas. > >> Good luck > >> -- > >> George H > >> george.dma at gmail.com > >> > >> > >> > >> 2010/6/21 Leandro Guimar?es : > >> > Hello, > >> > > >> > Change my virtual port to ttySXX worked fine... > >> > > >> > But now, im having another problem... > >> > > >> > I dont know why, but the virtual port is never calling the > SerialEvent > >> > in > >> > the SerialPortEventListenner... using the real Serial port, works > fine. > >> > But > >> > it doesnt work with the virtual port... > >> > > >> > > >> > Somebody have an idea?? Pleasse! > >> > > >> > Thank you!! > >> > Leandro Guimar?es > >> > > >> > > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > >> > wrote: > >> >> > >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of > >> >> ports > >> >> so: > >> >> > >> >> > >> >> > >> >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> >> > >> >> or whatever you need for the virtual port. The ports will enumerate > in > >> >> the order give (I don't know whether this is a guaranteed behavior or > >> >> just > >> >> the way it happens to be). > >> >> > >> >> Jim > >> >> > >> >> > >> >> > >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> >>> > >> >>> Hi, > >> >>> > >> >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >> >>> tcp:192.168.102.41:54321 > >> >>> > >> >>> its working fine for me, accessing the virtual port via CuteCom > or > >> >>> any terminal. But i can't access this port via RXTX. The > >> >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >> >>> > >> >>> Please guys, could you help me about that? > >> >>> > >> >>> > >> >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >> >>> > >> >>> Try to change name of the virtual port. > >> >>> > >> >>> I suppose you are using Linux, so: > >> >>> > >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >> >>> prefixes for the Linux com ports. > >> >>> Add your prefix there or change your VCP name to match to any > >> >>> predefined > >> >>> prefix there. > >> >>> > >> >>> Regards > >> >>> Mariusz > >> >>> > >> >>> > >> >>> > >> >>> Thank you very much! > >> >>> Leandro Guimar?es > >> >>> > >> >>> > >> >>> _______________________________________________ > >> >>> 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 > >> >> > >> >> -- > >> >> Jim Redman > >> >> (505) 662 5156 x85 > >> >> http://www.ergotech.com > >> >> _______________________________________________ > >> >> 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 > >> > > >> > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Tue Jun 22 07:20:17 2010 From: showard314 at gmail.com (Scott Howard) Date: Tue, 22 Jun 2010 09:20:17 -0400 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails Message-ID: This is forwarded from: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472053 by Jan Niehusmann I tried putting this on the bug tracker but I couldn't get access In the static initializer of gnu.io.RXTXPort, an exception when initializing the static variable 'z' is silently discarded: try { z = new Zystem(); } catch ( Exception e ) {}; This leads to NullPointerExceptions later, which are difficult to debug as the original exception is lost. I did change the code to try { z = new Zystem(); } catch ( Exception e ) { throw new Error(e.toString()); }; for debugging. Probably a more specific exception would be more appropriate, but the point is that leaving z undefined without reporting an error makes debugging unnecessarily difficult. Thanks. From g3vbv at blueyonder.co.uk Tue Jun 22 19:20:11 2010 From: g3vbv at blueyonder.co.uk (Sid Boyce) Date: Wed, 23 Jun 2010 02:20:11 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar Message-ID: <4C21614B.3060504@blueyonder.co.uk> I am using openSUSE 11.3 RC1. "rfcomm -a" lists no devices From dmesg =========== [288811.093151] usb 2-4.4.2: new full speed USB device using ehci_hcd and address 16 [288811.207421] usb 2-4.4.2: New USB device found, idVendor=0403, idProduct=6001 [288811.207431] usb 2-4.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [288811.207438] usb 2-4.4.2: Product: FT232R USB UART [288811.207443] usb 2-4.4.2: Manufacturer: FTDI [288811.207447] usb 2-4.4.2: SerialNumber: A100efz7 [288811.210509] ftdi_sio 2-4.4.2:1.0: FTDI USB Serial Device converter detected [288811.210534] usb 2-4.4.2: Detected FT232RL [288811.210536] usb 2-4.4.2: Number of endpoints 2 [288811.210538] usb 2-4.4.2: Endpoint 1 MaxPacketSize 64 [288811.210540] usb 2-4.4.2: Endpoint 2 MaxPacketSize 64 [288811.210541] usb 2-4.4.2: Setting MaxPacketSize 64 [288811.210822] usb 2-4.4.2: FTDI USB Serial Device converter now attached to ttyUSB1 Package built and installed OK in /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/amd64, it also installed /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/RXTXcomm.jar slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar RXTXcomm.jar Failed to load Main-Class manifest attribute from RXTXcomm.jar # rpm -qa |grep java java-1_6_0-sun-1.6.0.u20-1.15.x86_64 gcc44-java-4.4.2_20100116-1.2.x86_64 netbeans-javaparser-6.8-1.1.noarch gcc45-java-4.5.0_20100604-1.1.x86_64 ant-javadoc-1.7.1-11.1.noarch javahelp2-2.0.05-6.28.noarch gcc43-java-4.3.4_20091019-2.25.x86_64 gcc-java-4.5-5.2.x86_64 java-ca-certificates-1-5.1.noarch java-1_6_0-sun-devel-1.6.0.u20-1.15.x86_64 lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> echo $JAVA_HOME /usr/lib64/jvm/java-1.6.0-sun-1.6.0 > l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/amd64/ total 6440 drwxr-xr-x 8 root root 4096 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ drwxr-xr-x 2 root root 23 2010-06-18 16:41 headless/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 jli/ -rw-r--r-- 1 root root 652 2010-04-12 22:00 jvm.cfg -rwxr-xr-x 1 root root 15836 2010-04-12 22:25 libattach.so* -rwxr-xr-x 1 root root 757091 2010-04-12 22:25 libawt.so* -rwxr-xr-x 1 root root 413267 2010-04-12 22:25 libcmm.so* -rwxr-xr-x 1 root root 217736 2010-04-12 22:25 libdcpr.so* -rwxr-xr-x 1 root root 120029 2010-04-12 22:30 libdeploy.so* -rwxr-xr-x 1 root root 21670 2010-04-12 22:25 libdt_socket.so* -rwxr-xr-x 1 root root 692649 2010-04-12 22:25 libfontmanager.so* -rwxr-xr-x 1 root root 237073 2010-04-12 22:25 libhprof.so* -rwxr-xr-x 1 root root 50085 2010-04-12 22:25 libinstrument.so* -rwxr-xr-x 1 root root 27244 2010-04-12 22:25 libioser12.so* -rwxr-xr-x 1 root root 46723 2010-04-12 22:25 libj2gss.so* -rwxr-xr-x 1 root root 14272 2010-04-12 22:25 libj2pcsc.so* -rwxr-xr-x 1 root root 78017 2010-04-12 22:25 libj2pkcs11.so* -rwxr-xr-x 1 root root 7980 2010-04-12 22:25 libjaas_unix.so* -rwxr-xr-x 1 root root 28919 2010-04-12 22:25 libjava_crw_demo.so* -rwxr-xr-x 1 root root 231135 2010-04-12 22:25 libjava.so* -rwxr-xr-x 1 root root 7099 2010-04-12 22:25 libjawt.so* -rwxr-xr-x 1 root root 293725 2010-04-12 22:25 libjdwp.so* -rwxr-xr-x 1 root root 224947 2010-04-12 22:25 libjpeg.so* -rwxr-xr-x 1 root root 10964 2010-04-12 22:25 libjsig.so* -rwxr-xr-x 1 root root 260521 2010-04-12 22:25 libjsound.so* -rwxr-xr-x 1 root root 37449 2010-04-12 22:25 libmanagement.so* -rwxr-xr-x 1 root root 734280 2010-04-12 22:25 libmlib_image.so* -rwxr-xr-x 1 root root 6667 2010-04-12 22:25 libnative_chmod_g.so* -rwxr-xr-x 1 root root 6571 2010-04-12 22:25 libnative_chmod.so* -rwxr-xr-x 1 root root 111945 2010-04-12 22:25 libnet.so* -rwxr-xr-x 1 root root 43716 2010-04-12 22:25 libnio.so* -rwxr-xr-x 1 root root 15651 2010-04-12 22:25 libnpt.so* -rwxr-xr-x 1 root root 6420 2010-04-12 22:25 librmi.so* -rwxr-xr-x 1 root root 77907 2010-06-18 16:56 librxtxI2C-2.2pre1.so* -rw-r--r-- 1 root root 97530 2010-06-18 16:56 librxtxI2C.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxI2C.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxI2C.so -> librxtxI2C-2.2pre1.so* -rwxr-xr-x 1 root root 55253 2010-06-18 16:56 librxtxParallel-2.2pre1.so* -rw-r--r-- 1 root root 66164 2010-06-18 16:56 librxtxParallel.a -rwxr-xr-x 1 root root 1035 2010-06-18 16:56 librxtxParallel.la* lrwxrwxrwx 1 root root 26 2010-06-18 16:56 librxtxParallel.so -> librxtxParallel-2.2pre1.so* -rwxr-xr-x 1 root root 79049 2010-06-18 16:56 librxtxRaw-2.2pre1.so* -rw-r--r-- 1 root root 100218 2010-06-18 16:56 librxtxRaw.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxRaw.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxRaw.so -> librxtxRaw-2.2pre1.so* -rwxr-xr-x 1 root root 78134 2010-06-18 16:56 librxtxRS485-2.2pre1.so* -rw-r--r-- 1 root root 98662 2010-06-18 16:56 librxtxRS485.a -rwxr-xr-x 1 root root 1014 2010-06-18 16:56 librxtxRS485.la* lrwxrwxrwx 1 root root 23 2010-06-18 16:56 librxtxRS485.so -> librxtxRS485-2.2pre1.so* -rwxr-xr-x 1 root root 192681 2010-06-18 16:56 librxtxSerial-2.2pre1.so* -rw-r--r-- 1 root root 267524 2010-06-18 16:56 librxtxSerial.a -rwxr-xr-x 1 root root 1021 2010-06-18 16:56 librxtxSerial.la* lrwxrwxrwx 1 root root 24 2010-06-18 16:56 librxtxSerial.so -> librxtxSerial-2.2pre1.so* -rwxr-xr-x 1 root root 48036 2010-04-12 22:25 libsaproc.so* -rwxr-xr-x 1 root root 294575 2010-04-12 22:25 libsplashscreen.so* -rwxr-xr-x 1 root root 134786 2010-04-12 22:25 libunpack.so* -rwxr-xr-x 1 root root 66292 2010-04-12 22:25 libverify.so* -rwxr-xr-x 1 root root 91191 2010-04-12 22:25 libzip.so* drwxr-xr-x 2 root root 23 2010-06-18 16:41 motif21/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 native_threads/ drwxr-xr-x 2 root root 56 2010-06-18 16:41 server/ -rw------- 1 root root 0 2010-06-18 16:53 stC2p3qT -rw------- 1 root root 0 2010-06-18 16:53 stJpl8lW -rw------- 1 root root 0 2010-06-18 16:53 stnb1qWY -rw------- 1 root root 0 2010-06-18 16:53 stYjTgRS -rw------- 1 root root 0 2010-06-18 16:53 stZA8aVV drwxr-xr-x 2 root root 23 2010-06-18 16:41 xawt/ lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/ total 1300 drwxr-xr-x 2 root root 125 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ -rw-r--r-- 1 root root 8239 2010-04-12 22:08 dnsns.jar -rw-r--r-- 1 root root 842216 2010-06-10 12:45 localedata.jar -rw-r--r-- 1 root root 429 2010-04-12 22:23 meta-index -rwxr-xr-x 1 root root 61389 2010-06-18 16:56 RXTXcomm.jar* -rw-r--r-- 1 root root 170239 2010-04-12 21:58 sunjce_provider.jar -rw-r--r-- 1 root root 230608 2010-04-12 22:08 sunpkcs11.jar Help appreciated. 73 ... Sid. -- Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support Specialist, Cricket Coach Microsoft Windows Free Zone - Linux used for all Computing Tasks From Kustaa.Nyholm at planmeca.com Tue Jun 22 23:38:46 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 08:38:46 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: Message-ID: > I did change the code to > try { > z = new Zystem(); > } catch ( Exception e ) { > throw new Error(e.toString()); > }; Is there a reason why this could/should not be: > try { > z = new Zystem(); > } catch ( Throwable e ) { > e.printStackTrace(System.err); > }; From msemtd at googlemail.com Wed Jun 23 02:14:25 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:14:25 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar In-Reply-To: <4C21614B.3060504@blueyonder.co.uk> References: <4C21614B.3060504@blueyonder.co.uk> Message-ID: On 23 June 2010 02:20, Sid Boyce wrote: > slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar > RXTXcomm.jar > Failed to load Main-Class manifest attribute from > RXTXcomm.jar > Help appreciated. > 73 ... Sid. Well Sid, it's pretty obvious to me: you're trying to launch a jar that doesn't contain a main(). What exactly are you trying to achieve by running "java -jar RXTXcomm.jar"? Regards, Michael Erskine. From msemtd at googlemail.com Wed Jun 23 02:17:11 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:17:11 +0100 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: On 23 June 2010 06:38, Kustaa Nyholm wrote: > >> I did change the code to >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >> ? ? ? ? ? ? ? ?}; > > Is there a reason why this could/should not be: > > >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >> ? ? ? ? ? ? ? ?}; Or even just let the exception bubble up and kill whatever thread caused the class to load :) I vote for the removal of Zystem BTW! Regards, Michael Erskine. From george.dma at gmail.com Wed Jun 23 02:34:07 2010 From: george.dma at gmail.com (George H) Date: Wed, 23 Jun 2010 11:34:07 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: -- George H george.dma at gmail.com On Wed, Jun 23, 2010 at 11:17 AM, Michael Erskine wrote: > On 23 June 2010 06:38, Kustaa Nyholm wrote: >> >>> I did change the code to >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >>> ? ? ? ? ? ? ? ?}; >> >> Is there a reason why this could/should not be: >> >> >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >>> ? ? ? ? ? ? ? ?}; > > Or even just let the exception bubble up and kill whatever thread > caused the class to load :) > > I vote for the removal of Zystem BTW! > > Regards, > Michael Erskine. I would prefer that an exception is thrown rather than the stack trace be printed. If anyone is using loggers then it would be useful to catch the exception and log it, rather than let it come out in the error stream where no one might look. From Steffen.DETTMER at ingenico.com Wed Jun 23 03:28:45 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 11:28:45 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: <20100623092844.GF20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 08:38 +0300: > > I did change the code to > > try { > > z = new Zystem(); > > } catch ( Exception e ) { > > throw new Error(e.toString()); > > }; > > Is there a reason why this could/should not be: > > > try { > > z = new Zystem(); > > } catch ( Throwable e ) { > > e.printStackTrace(System.err); > > }; Is this intentionally not throwing the exception? Well, then it still would be discarded (althrough not neccesarily silently :)). BTW, I don't think System.err is a good idea. It is `statically initialized'? I think then this means it is unclear who the caller is and who could catch this exception. Wouldn't it be better to store the exception in a member and throw it when needing Zystem (e.g. in new or open)? 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 Kustaa.Nyholm at planmeca.com Wed Jun 23 03:55:30 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 12:55:30 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: >> Is there a reason why this could/should not be: >> >>> try { >>> z = new Zystem(); >>> } catch ( Throwable e ) { >>> e.printStackTrace(System.err); >>> }; > > Is this intentionally not throwing the exception? Well, no, just a hasty reply from my part. > still would be discarded (althrough not neccesarily silently :)). > BTW, I don't think System.err is a good idea. > > It is `statically initialized'? I think then this means it is > unclear who the caller is and who could catch this exception. > Even so re-throwing the exception would make sense so that the application developer has a chance to handle this in whichever way they want. Of course logically this should not then print the stacktrace because that is the responsibility of the application developer. But so many do not handle these cases sensibly so from the application user point of view it is nice to have something on the console to aid in trouble shooting. Have not checked the context in which this happens so that might influence my opinion. > Wouldn't it be better to store the exception in a member and > throw it when needing Zystem (e.g. in new or open) I'm of the fail-fast school of thought so I think it should be reported and re-thrown as it happens, not later. br Kusti From pietro.galassi at gmail.com Wed Jun 23 05:59:29 2010 From: pietro.galassi at gmail.com (Pietro Galassi) Date: Wed, 23 Jun 2010 13:59:29 +0200 Subject: [Rxtx] Resource temporarily unavaible on writeByte() Message-ID: Hi, i have successfully installe RXTX 64bit version from UBUNTO repository. I wrote a simple test program and it shows i have 3 ports avaible on my system: /dev/ttyS1 - Serial /dev/ttyS0 - Serial /dev/lp0 - Parallel but as soon as i try to "writeByte" any data on the parallel port it always gives me: java.io.IOException: Resource temporarily unavaible on writeByte() My simple code is: ... outputStream = parallelPort.getOutputStream() ; System.out.println("Write..."); outputStream.write(88); outputStream.flush(); outputStream.close(); ... int mode = parallelPort.getMode(); gives always 0. Anyone can help pls ? Thanks a lot, Pietro Galassi -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Jun 23 10:35:37 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 18:35:37 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: <20100623163536.GI20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 12:55 +0300: > > Wouldn't it be better to store the exception in a member and > > throw it when needing Zystem (e.g. in new or open) > > I'm of the fail-fast school of thought so I think it should be > reported and re-thrown as it happens, not later. Ahh yes, I agree, in general it is much better to fail quick, loud and verbosely, right! However, if this is a static { } block, AFAIK it is not defined when it will be executed (Before application start? Or later, when loading the class later? Or when using it first time?). If the exception would be thrown before main() is called, I think it is difficult to catch it. I think some general global hook must be used to do so. Simpler to handle, if it is thrown when invocating some function, then it can be caught by try { } catch. (or am I wrong or outdated?) 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 rbreznak at neuronrobotics.com Wed Jun 23 11:46:21 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Wed, 23 Jun 2010 13:46:21 -0400 Subject: [Rxtx] Bundling native libraries Message-ID: Hello, I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. Has anyone had experience in doing this? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Wed Jun 23 18:26:17 2010 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 23 Jun 2010 17:26:17 -0700 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Whoops, forgot to copy this to the RXTX list ... ---------- Forwarded message ---------- From: Brian Schlining Date: Wed, Jun 23, 2010 at 11:11 Subject: Re: [Rxtx] Bundling native libraries To: "Breznak, Robert" Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a > one jar. Its to the point where I have an Ant script that pulls all of the > jars together, but I haven't been able to get the native libraries to work; > They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the > user to get and use. They don't need to worry about external dependencies > and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 24 00:37:35 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 24 Jun 2010 08:37:35 +0200 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Here is a snippet from my ant file. I actually unjar the rxtx jar file and add my own classes to it for Mac and WIndows. The snippet below is actually for Mac but just for your info I am using nsis and launch4j to create an exectuable for windows. I also copy the rxtx libs to the root folder of my application: On 24.06.2010, at 02:26, Brian Schlining wrote: > Whoops, forgot to copy this to the RXTX list ... > > ---------- Forwarded message ---------- > From: Brian Schlining > Date: Wed, Jun 23, 2010 at 11:11 > Subject: Re: [Rxtx] Bundling native libraries > To: "Breznak, Robert" > > > Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc > > On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 11:29:21 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 12:29:21 -0500 Subject: [Rxtx] Port to RS422? Message-ID: Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jun 24 12:18:10 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:18:10 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Thu Jun 24 12:22:15 2010 From: showard314 at gmail.com (Scott Howard) Date: Thu, 24 Jun 2010 14:22:15 -0400 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, On Thu, Jun 24, 2010 at 1:29 PM, James, David (DJ) (SA-1) wrote: > Has anyone tried porting RxTx to RS422? Don't know for sure but . . . > If not, where is all the C code for the other implementations so that I can > give it a shot? http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code There is a file called "PORTING" in the root of rxtx-devel Also refer to the (outdated) information on: http://users.frii.com/jarvi/rxtx/porting.html which has similar information to the PORTING file (trust the PORTING file in case of conflicts) I attached a copy of that file from the 2.2pre2 release to this email. Also, see the "toy box" section: http://rxtx.qbang.org/wiki/index.php/Download for compiled downloads on other platforms good luck. ~Scott -------------- next part -------------- A non-text attachment was scrubbed... Name: PORTING Type: application/octet-stream Size: 5017 bytes Desc: not available URL: From djjames at drs-ssi.com Thu Jun 24 12:22:52 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 13:22:52 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ 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 Jun 24 12:39:42 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:39:42 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 14:10:41 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 15:10:41 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I agree with the RS422/RS485/RS232 control side being the same. Everything I have read says that this should be so. I did notice that there is a RS485 implementation within RxTx that RS485Port.java states is "Non functional". I was thinking that I could/should use the RS485 code as a basis for the RS422 code, if necessary. But this seems a rash course of action if it doesn't function. I am then trying to debug 2 sets of code, instead of working from a good set to get my "bad" set to work correctly. 1) I don't understand the first question "does your RS422 is voltage interface to RS232?" What is "is voltage"? What is an "is voltage interface"? I apologize for my ignorance about this. I have a "true" RS422 port, +/- 5 volt differential if that is what you mean. There is no cross talk between the RS232 and RS422 that I can detect. I know that the RS422 port works, from the command line I have copied a file to that tty device and see voltage changes on my scope on the transmit+ and transmit- pins. 2) No USB dongles are involved in the "badness". That said, as a test, I have run the target java code on a laptop with a USB to serial dongle and a RS232 to RS422 converter hooked to my RS422 source and the serial communications is great. I know that my messaging code is parsing the messages and that the RxTx RS232 code is getting the correct interrupts for the raw data to build the messages up from the raw data. 3) See 2). When I enumerate the ports on my Linux machine, the RS422 port shows up as a serial port. portList = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier foundPortId = null; while (portList.hasMoreElements()) { portId = (gnu.io.CommPortIdentifier) portList.nextElement(); int portType = portId.getPortType(); System.out.println("Found port " + portId.getName()); System.out.println(" of port type " + portId.getPortType()); if (portType == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { portFound = true; foundPortId = portId; } } } I hope this is the information that you requested. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:40 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Thu Jun 24 16:25:11 2010 From: jredman at ergotech.com (Jim Redman) Date: Thu, 24 Jun 2010 16:25:11 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C23DB47.5070308@ergotech.com> RS485 has a 2-wire, half-duplex mode. In this case you need a mechanism to switch sender and receiver. In many cases, the RS485 port will do this for you. Most RS232<->RS485 converters will also manage the switching in a way that is totally transparent to you. In principle, if you don't have a port that handles switching automatically for you, you could control this switching in software. Realistically, unless you have a long delay between sending and reply generation, say 100ms or more, it would be difficult. With most system, the response comes back very quickly and user level code will be too slow to manage that. I think that RS422 is always 4-wire. From the software standpoint, it, and 4-wire RS422 (and current loop and ...) all look the same. There are some electrical issues with RS422 and RS485 particularly termination. I haven't hooked up 485 or 422 in a while so I don't remember all the details, but if you get it wrong it probably won't work. Jim On 06/24/2010 12:39 PM, Mariusz Dec wrote: > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, > I have a 232 port and everything is wonderful. I set the 422 port > up similarly and see no events firing (except output buffer empty). > I set up a scope on the connector and copy a file to the port > (/dev/ttyS1 in my case) and see output. I do the same through RxTx > and see nothing. If this is a setup problem, I am confused as I set > the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so > that I can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From mariusz.dec at gmail.com Fri Jun 25 01:52:48 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 25 Jun 2010 09:52:48 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, now you are sleeping and I have the next day :) So - "voltage interface" means that you have RS232 interface and voltage level converter to use it as RS422. In such case proper work of the RS232 determines proper work of the RS422 (if hw works). In case you make tests on physically different controllers, there may be a lot of traps more, especially now, when we have milions of USB/RS232 dongles vendors and milions of not-properly-working VCP-drivers. Your sentence: "dongle and a RS232 to RS422 converter hooked to" says that you have one RS232 controller and you are using "voltage interface" named >converter< to connect to external RS422 source. It means that only problem is somewhere on the physical part of the interface. If you are seeing signals on the scope, means that you may send dat ok. if you have checked that your USB-serial dongle works good with events, look for the hw mistakes (wiring etc). If you haven't yet checked if your USB-serial dongle works good with events read this: http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html AND always remember that USB-serial dongle isn't serial COM port, this is VIRTUAL Com Port. And this may make a big difference... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t function. > I am then trying to debug 2 sets of code, instead of working from a good set > to get my ?bad? set to work correctly. > > > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on the > transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is parsing > the messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up as > a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:40 PM > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't > the same ? > > Regards > Mariusz > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Fri Jun 25 01:54:39 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 25 Jun 2010 08:54:39 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: <4C23DB47.5070308@ergotech.com> References: <4C23DB47.5070308@ergotech.com> Message-ID: I'm happily using RXTX to communicate with RS422 devices in 4-wire mode using KK-Systems K2 RS232-RS422/RS485 converters (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). Running at 115200 baud -- no issues at all. Regards, Michael Erskine. From jredman at ergotech.com Fri Jun 25 11:29:10 2010 From: jredman at ergotech.com (Jim Redman) Date: Fri, 25 Jun 2010 11:29:10 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <4C23DB47.5070308@ergotech.com> Message-ID: <4C24E766.50102@ergotech.com> Note that the K2 doesn't do automatic switching for RS485, the K2-ADE does. For true RS422 this is irrelevant. We've used a bunch of converters, including some USB versions, some from B&B (http://www.bb-elec.com/) and some (a lot?) of the non-name, low cost RS232-RS485 converters that are out there. There really is no difference as far as the software is concerned. The cabling and termination of 485/422 do tend to be more problematic, and it's likely that the problem lies there rather than anywhere else. Jim On 06/25/2010 01:54 AM, Michael Erskine wrote: > I'm happily using RXTX to communicate with RS422 devices in 4-wire > mode using KK-Systems K2 RS232-RS422/RS485 converters > (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). > Running at 115200 baud -- no issues at all. > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From robohobby at gmail.com Sun Jun 27 07:41:33 2010 From: robohobby at gmail.com (Oleg Lyubchenko) Date: Sun, 27 Jun 2010 17:41:33 +0400 Subject: [Rxtx] Is it possible to receive data from serial port, using RXTX under Linux? Message-ID: Hi, I am trying to use RxTx for a simple project. Small board ETX should communicate with several devices, using serial ports. The application should work under Linux. Java is my favorite language and that was the reason, why RXTX was selected for the task. Under Windows all was OK. But under Linux I see strange thing - It is possible to send data to the port, but it is impossible to read data from port under Linux. Lock files are OK - this part work as it should. User (the user is 'root') has permissions to read-write to port (to device). Kermit and minicom works fine with the modem. The application can send data, but can not read data. As a test example I use standard example class - TwoWaySerialComm.java . I tried both versions of this file - one version without Events and version with Events. I see the same picture with Puppy Linux, with Ubuntu 9.10, OpenSuSE 11. As a hardware I use ETX board and notebook Samsung R40. Both platforms shows the same result - can write to port, can not read from port. What I mean by "send and receive data": I do very simple test - after connection to the device I type "atz" and waiting for the answer from the modem. Normal answer should be "OK". Under Windows, using "TwoWaySerialComm" I see : ATZ ATZ OK Under Linux I see only ATZ ATZ (No normal answer 'OK') Any ideas? PS: If you want to see the code, you can download the code of the project from http://www.robohobby.com/downloads/JavaRxTx.zip There is nothing special there - just project for Netbeans with code of two standard examples. to run it under Windows, use JavaRxTx\r.bat for Linux, use JavaRxTx\sh r.sh Sincerely, Oleg -------------- next part -------------- An HTML attachment was scrubbed... URL: From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From leo.guimaraes at gmail.com Fri Jun 18 13:29:14 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Fri, 18 Jun 2010 15:29:14 -0400 Subject: [Rxtx] Virtual Port with RXTX Message-ID: Hello everybody, Please, im crazy trying to solve this problem: I created a virtual port in my server to receive data over the ethernet from a serial port in the client machine. Im using socat for that: In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: 192.168.102.41:54321 its working fine for me, accessing the virtual port via CuteCom or any terminal. But i can't access this port via RXTX. The getPortIdentifiers() method returns only the /dev/ttyS0 port. Please guys, could you help me about that? Thank you very much! Leandro Guimar?es -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Fri Jun 18 23:43:50 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 19 Jun 2010 07:43:50 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: Hi, In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: > 192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or any > terminal. But i can't access this port via RXTX. The getPortIdentifiers() > method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock Try to change name of the virtual port. I suppose you are using Linux, so: In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid prefixes for the Linux com ports. Add your prefix there or change your VCP name to match to any predefined prefix there. Regards Mariusz > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Sat Jun 19 08:03:06 2010 From: jredman at ergotech.com (Jim Redman) Date: Sat, 19 Jun 2010 08:03:06 -0600 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: <4C1CCE1A.90201@ergotech.com> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports so: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 or whatever you need for the virtual port. The ports will enumerate in the order give (I don't know whether this is a guaranteed behavior or just the way it happens to be). Jim On 06/18/2010 11:43 PM, Mariusz Dec wrote: > Hi, > > In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > tcp:192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or > any terminal. But i can't access this port via RXTX. The > getPortIdentifiers() method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork > file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > > Try to change name of the virtual port. > > I suppose you are using Linux, so: > > In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > prefixes for the Linux com ports. > Add your prefix there or change your VCP name to match to any predefined > prefix there. > > Regards > Mariusz > > > > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From leo.guimaraes at gmail.com Mon Jun 21 13:23:26 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 16:23:26 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: <4C1CCE1A.90201@ergotech.com> References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hello, Change my virtual port to ttySXX worked fine... But now, im having another problem... I dont know why, but the virtual port is never calling the SerialEvent in the SerialPortEventListenner... using the real Serial port, works fine. But it doesnt work with the virtual port... Somebody have an idea?? Pleasse! Thank you!! Leandro Guimar?es On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: > You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > so: > > > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > > or whatever you need for the virtual port. The ports will enumerate in the > order give (I don't know whether this is a guaranteed behavior or just the > way it happens to be). > > Jim > > > > > On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> Hi, >> >> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave >> tcp:192.168.102.41:54321 >> >> >> its working fine for me, accessing the virtual port via CuteCom or >> any terminal. But i can't access this port via RXTX. The >> getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >> Please guys, could you help me about that? >> >> >> In client machine: socat tcp-l:54321,reuseaddr,fork >> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >> Try to change name of the virtual port. >> >> I suppose you are using Linux, so: >> >> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> prefixes for the Linux com ports. >> Add your prefix there or change your VCP name to match to any predefined >> prefix there. >> >> Regards >> Mariusz >> >> >> >> Thank you very much! >> Leandro Guimar?es >> >> >> _______________________________________________ >> 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 >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > > _______________________________________________ > 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 Mon Jun 21 13:47:13 2010 From: george.dma at gmail.com (George H) Date: Mon, 21 Jun 2010 19:47:13 +0000 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, This might be because it is a virtual port. I used to do testing on usb/serial port and there were some "signals" it would not send me that a real serial port would. Try to see what signals your serial port sends you that the virtual port doesn't. I think there are some serial port sniffers out there where you can intercept the signals. Also would do good if you look at some technical tutorials on how serial port signals work. A good site which I read over many times to try to understand why things are the way they are is http://www.arcelect.com/rs232.htm I hope this gave you some ideas. Good luck -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Hello, > > ?? Change my virtual port to ttySXX worked fine... > > ?? But now, im having another problem... > > ? I dont know why, but the virtual port is never calling the SerialEvent in > the SerialPortEventListenner... using the real Serial port, works fine. But > it doesnt work with the virtual port... > > > ?? Somebody have an idea?? Pleasse! > > Thank you!! > Leandro Guimar?es > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports >> so: >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> the order give (I don't know whether this is a guaranteed behavior or just >> the way it happens to be). >> >> Jim >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >>> >>> Hi, >>> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >>> ? ?tcp:192.168.102.41:54321 >>> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >>> ? ?any terminal. But i can't access this port via RXTX. The >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >>> >>> ? ? ? Please guys, could you help me about that? >>> >>> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >>> >>> Try to change name of the virtual port. >>> >>> I suppose you are using Linux, so: >>> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >>> prefixes for the Linux com ports. >>> Add your prefix there or change your VCP name to match to any predefined >>> prefix there. >>> >>> Regards >>> Mariusz >>> >>> >>> >>> ? ?Thank you very much! >>> ? ?Leandro Guimar?es >>> >>> >>> ? ?_______________________________________________ >>> ? ?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 >> >> -- >> Jim Redman >> (505) 662 5156 x85 >> http://www.ergotech.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From leo.guimaraes at gmail.com Mon Jun 21 14:56:15 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 17:56:15 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Thanks George, Please, do you know what represents a "data available" in RXTX? Wich signal calls the Listener's Notify? Its the last thing that i need to do to finish my project here! Thank you very much! Leandro Guimar?es 2010/6/21 George H > Hi, > > This might be because it is a virtual port. > I used to do testing on usb/serial port and there were some "signals" > it would not send me that a real serial port would. > Try to see what signals your serial port sends you that the virtual > port doesn't. I think there are some serial port sniffers out there > where you can intercept the signals. Also would do good if you look at > some technical tutorials on how serial port signals work. > > A good site which I read over many times to try to understand why > things are the way they are is http://www.arcelect.com/rs232.htm > > I hope this gave you some ideas. > Good luck > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Hello, > > > > Change my virtual port to ttySXX worked fine... > > > > But now, im having another problem... > > > > I dont know why, but the virtual port is never calling the SerialEvent > in > > the SerialPortEventListenner... using the real Serial port, works fine. > But > > it doesnt work with the virtual port... > > > > > > Somebody have an idea?? Pleasse! > > > > Thank you!! > > Leandro Guimar?es > > > > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > wrote: > >> > >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > >> so: > >> > >> > >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> > >> or whatever you need for the virtual port. The ports will enumerate in > >> the order give (I don't know whether this is a guaranteed behavior or > just > >> the way it happens to be). > >> > >> Jim > >> > >> > >> > >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >>> > >>> Hi, > >>> > >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >>> tcp:192.168.102.41:54321 > >>> > >>> its working fine for me, accessing the virtual port via CuteCom or > >>> any terminal. But i can't access this port via RXTX. The > >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >>> > >>> Please guys, could you help me about that? > >>> > >>> > >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >>> > >>> Try to change name of the virtual port. > >>> > >>> I suppose you are using Linux, so: > >>> > >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >>> prefixes for the Linux com ports. > >>> Add your prefix there or change your VCP name to match to any > predefined > >>> prefix there. > >>> > >>> Regards > >>> Mariusz > >>> > >>> > >>> > >>> Thank you very much! > >>> Leandro Guimar?es > >>> > >>> > >>> _______________________________________________ > >>> 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 > >> > >> -- > >> Jim Redman > >> (505) 662 5156 x85 > >> http://www.ergotech.com > >> _______________________________________________ > >> 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 george.dma at gmail.com Mon Jun 21 22:51:50 2010 From: george.dma at gmail.com (George H) Date: Tue, 22 Jun 2010 07:51:50 +0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Did you read the site I posted? If you did you would have figured out which pin signal on the RS232 interface most likely triggers the data available event. It might be pin 2 and it might be pin 3, depends what kind of serial port you have and the cable. Plus i'm no expert on on RS-232 interfaces, I just know that if I have my hardware in front of me, and the source code of rxtx and a rs-232 specifications sheet then I can debug the problem and find out. This is what I believe you should do to get started to find out the "what, where and why" of your problem. -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Thanks George, > > ?? Please, do you know what represents a "data available" in RXTX? Wich > signal calls the Listener's Notify? > > ?? Its the last thing that i need to do to finish my project here! > > Thank you very much! > > Leandro Guimar?es > > > 2010/6/21 George H >> >> Hi, >> >> This might be because it is a virtual port. >> I used to do testing on usb/serial port and there were some "signals" >> it would not send me that a real serial port would. >> Try to see what signals your serial port sends you that the virtual >> port doesn't. I think there are some serial port sniffers out there >> where you can intercept the signals. Also would do good if you look at >> some technical tutorials on how serial port signals work. >> >> A good site which I read over many times to try to understand why >> things are the way they are is http://www.arcelect.com/rs232.htm >> >> I hope this gave you some ideas. >> Good luck >> -- >> George H >> george.dma at gmail.com >> >> >> >> 2010/6/21 Leandro Guimar?es : >> > Hello, >> > >> > ?? Change my virtual port to ttySXX worked fine... >> > >> > ?? But now, im having another problem... >> > >> > ? I dont know why, but the virtual port is never calling the SerialEvent >> > in >> > the SerialPortEventListenner... using the real Serial port, works fine. >> > But >> > it doesnt work with the virtual port... >> > >> > >> > ?? Somebody have an idea?? Pleasse! >> > >> > Thank you!! >> > Leandro Guimar?es >> > >> > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman >> > wrote: >> >> >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of >> >> ports >> >> so: >> >> >> >> >> >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> >> the order give (I don't know whether this is a guaranteed behavior or >> >> just >> >> the way it happens to be). >> >> >> >> Jim >> >> >> >> >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >> >>> >> >>> Hi, >> >>> >> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >> >>> ? ?tcp:192.168.102.41:54321 >> >>> >> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >> >>> ? ?any terminal. But i can't access this port via RXTX. The >> >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >>> >> >>> ? ? ? Please guys, could you help me about that? >> >>> >> >>> >> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >>> >> >>> Try to change name of the virtual port. >> >>> >> >>> I suppose you are using Linux, so: >> >>> >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> >>> prefixes for the Linux com ports. >> >>> Add your prefix there or change your VCP name to match to any >> >>> predefined >> >>> prefix there. >> >>> >> >>> Regards >> >>> Mariusz >> >>> >> >>> >> >>> >> >>> ? ?Thank you very much! >> >>> ? ?Leandro Guimar?es >> >>> >> >>> >> >>> ? ?_______________________________________________ >> >>> ? ?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 >> >> >> >> -- >> >> Jim Redman >> >> (505) 662 5156 x85 >> >> http://www.ergotech.com >> >> _______________________________________________ >> >> Rxtx mailing list >> >> Rxtx at qbang.org >> >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > >> > _______________________________________________ >> > Rxtx mailing list >> > Rxtx at qbang.org >> > http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > > > From mariusz.dec at gmail.com Tue Jun 22 05:32:01 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 22 Jun 2010 13:32:01 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, I am working with virtual ports only. Because of some problems with events I have changed whole idea. I did a thread in Java which is looking for port data in pool. If data comes in, I parse it and than generate an Java exception for the application. This works very good from several months and has an advantage more - is faster than events services. I have published many times an example code. Look for 2009'november thread "RXTX close() problem solved". In this example you can set Exception generation in read thread. There is a lot of "try-catch" loops which prevents system while you disconnect USB as well. For me works very good in Mac/Linux and Windows. Regards Mariusz 2010/6/22 George H > Did you read the site I posted? If you did you would have figured out > which pin signal on the RS232 interface most likely triggers the data > available event. > It might be pin 2 and it might be pin 3, depends what kind of serial > port you have and the cable. > > Plus i'm no expert on on RS-232 interfaces, I just know that if I have > my hardware in front of me, and the source code of rxtx and a rs-232 > specifications sheet then I can debug the problem and find out. This > is what I believe you should do to get started to find out the "what, > where and why" of your problem. > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Thanks George, > > > > Please, do you know what represents a "data available" in RXTX? Wich > > signal calls the Listener's Notify? > > > > Its the last thing that i need to do to finish my project here! > > > > Thank you very much! > > > > Leandro Guimar?es > > > > > > 2010/6/21 George H > >> > >> Hi, > >> > >> This might be because it is a virtual port. > >> I used to do testing on usb/serial port and there were some "signals" > >> it would not send me that a real serial port would. > >> Try to see what signals your serial port sends you that the virtual > >> port doesn't. I think there are some serial port sniffers out there > >> where you can intercept the signals. Also would do good if you look at > >> some technical tutorials on how serial port signals work. > >> > >> A good site which I read over many times to try to understand why > >> things are the way they are is http://www.arcelect.com/rs232.htm > >> > >> I hope this gave you some ideas. > >> Good luck > >> -- > >> George H > >> george.dma at gmail.com > >> > >> > >> > >> 2010/6/21 Leandro Guimar?es : > >> > Hello, > >> > > >> > Change my virtual port to ttySXX worked fine... > >> > > >> > But now, im having another problem... > >> > > >> > I dont know why, but the virtual port is never calling the > SerialEvent > >> > in > >> > the SerialPortEventListenner... using the real Serial port, works > fine. > >> > But > >> > it doesnt work with the virtual port... > >> > > >> > > >> > Somebody have an idea?? Pleasse! > >> > > >> > Thank you!! > >> > Leandro Guimar?es > >> > > >> > > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > >> > wrote: > >> >> > >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of > >> >> ports > >> >> so: > >> >> > >> >> > >> >> > >> >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> >> > >> >> or whatever you need for the virtual port. The ports will enumerate > in > >> >> the order give (I don't know whether this is a guaranteed behavior or > >> >> just > >> >> the way it happens to be). > >> >> > >> >> Jim > >> >> > >> >> > >> >> > >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> >>> > >> >>> Hi, > >> >>> > >> >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >> >>> tcp:192.168.102.41:54321 > >> >>> > >> >>> its working fine for me, accessing the virtual port via CuteCom > or > >> >>> any terminal. But i can't access this port via RXTX. The > >> >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >> >>> > >> >>> Please guys, could you help me about that? > >> >>> > >> >>> > >> >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >> >>> > >> >>> Try to change name of the virtual port. > >> >>> > >> >>> I suppose you are using Linux, so: > >> >>> > >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >> >>> prefixes for the Linux com ports. > >> >>> Add your prefix there or change your VCP name to match to any > >> >>> predefined > >> >>> prefix there. > >> >>> > >> >>> Regards > >> >>> Mariusz > >> >>> > >> >>> > >> >>> > >> >>> Thank you very much! > >> >>> Leandro Guimar?es > >> >>> > >> >>> > >> >>> _______________________________________________ > >> >>> 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 > >> >> > >> >> -- > >> >> Jim Redman > >> >> (505) 662 5156 x85 > >> >> http://www.ergotech.com > >> >> _______________________________________________ > >> >> 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 > >> > > >> > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Tue Jun 22 07:20:17 2010 From: showard314 at gmail.com (Scott Howard) Date: Tue, 22 Jun 2010 09:20:17 -0400 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails Message-ID: This is forwarded from: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472053 by Jan Niehusmann I tried putting this on the bug tracker but I couldn't get access In the static initializer of gnu.io.RXTXPort, an exception when initializing the static variable 'z' is silently discarded: try { z = new Zystem(); } catch ( Exception e ) {}; This leads to NullPointerExceptions later, which are difficult to debug as the original exception is lost. I did change the code to try { z = new Zystem(); } catch ( Exception e ) { throw new Error(e.toString()); }; for debugging. Probably a more specific exception would be more appropriate, but the point is that leaving z undefined without reporting an error makes debugging unnecessarily difficult. Thanks. From g3vbv at blueyonder.co.uk Tue Jun 22 19:20:11 2010 From: g3vbv at blueyonder.co.uk (Sid Boyce) Date: Wed, 23 Jun 2010 02:20:11 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar Message-ID: <4C21614B.3060504@blueyonder.co.uk> I am using openSUSE 11.3 RC1. "rfcomm -a" lists no devices From dmesg =========== [288811.093151] usb 2-4.4.2: new full speed USB device using ehci_hcd and address 16 [288811.207421] usb 2-4.4.2: New USB device found, idVendor=0403, idProduct=6001 [288811.207431] usb 2-4.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [288811.207438] usb 2-4.4.2: Product: FT232R USB UART [288811.207443] usb 2-4.4.2: Manufacturer: FTDI [288811.207447] usb 2-4.4.2: SerialNumber: A100efz7 [288811.210509] ftdi_sio 2-4.4.2:1.0: FTDI USB Serial Device converter detected [288811.210534] usb 2-4.4.2: Detected FT232RL [288811.210536] usb 2-4.4.2: Number of endpoints 2 [288811.210538] usb 2-4.4.2: Endpoint 1 MaxPacketSize 64 [288811.210540] usb 2-4.4.2: Endpoint 2 MaxPacketSize 64 [288811.210541] usb 2-4.4.2: Setting MaxPacketSize 64 [288811.210822] usb 2-4.4.2: FTDI USB Serial Device converter now attached to ttyUSB1 Package built and installed OK in /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/amd64, it also installed /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/RXTXcomm.jar slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar RXTXcomm.jar Failed to load Main-Class manifest attribute from RXTXcomm.jar # rpm -qa |grep java java-1_6_0-sun-1.6.0.u20-1.15.x86_64 gcc44-java-4.4.2_20100116-1.2.x86_64 netbeans-javaparser-6.8-1.1.noarch gcc45-java-4.5.0_20100604-1.1.x86_64 ant-javadoc-1.7.1-11.1.noarch javahelp2-2.0.05-6.28.noarch gcc43-java-4.3.4_20091019-2.25.x86_64 gcc-java-4.5-5.2.x86_64 java-ca-certificates-1-5.1.noarch java-1_6_0-sun-devel-1.6.0.u20-1.15.x86_64 lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> echo $JAVA_HOME /usr/lib64/jvm/java-1.6.0-sun-1.6.0 > l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/amd64/ total 6440 drwxr-xr-x 8 root root 4096 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ drwxr-xr-x 2 root root 23 2010-06-18 16:41 headless/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 jli/ -rw-r--r-- 1 root root 652 2010-04-12 22:00 jvm.cfg -rwxr-xr-x 1 root root 15836 2010-04-12 22:25 libattach.so* -rwxr-xr-x 1 root root 757091 2010-04-12 22:25 libawt.so* -rwxr-xr-x 1 root root 413267 2010-04-12 22:25 libcmm.so* -rwxr-xr-x 1 root root 217736 2010-04-12 22:25 libdcpr.so* -rwxr-xr-x 1 root root 120029 2010-04-12 22:30 libdeploy.so* -rwxr-xr-x 1 root root 21670 2010-04-12 22:25 libdt_socket.so* -rwxr-xr-x 1 root root 692649 2010-04-12 22:25 libfontmanager.so* -rwxr-xr-x 1 root root 237073 2010-04-12 22:25 libhprof.so* -rwxr-xr-x 1 root root 50085 2010-04-12 22:25 libinstrument.so* -rwxr-xr-x 1 root root 27244 2010-04-12 22:25 libioser12.so* -rwxr-xr-x 1 root root 46723 2010-04-12 22:25 libj2gss.so* -rwxr-xr-x 1 root root 14272 2010-04-12 22:25 libj2pcsc.so* -rwxr-xr-x 1 root root 78017 2010-04-12 22:25 libj2pkcs11.so* -rwxr-xr-x 1 root root 7980 2010-04-12 22:25 libjaas_unix.so* -rwxr-xr-x 1 root root 28919 2010-04-12 22:25 libjava_crw_demo.so* -rwxr-xr-x 1 root root 231135 2010-04-12 22:25 libjava.so* -rwxr-xr-x 1 root root 7099 2010-04-12 22:25 libjawt.so* -rwxr-xr-x 1 root root 293725 2010-04-12 22:25 libjdwp.so* -rwxr-xr-x 1 root root 224947 2010-04-12 22:25 libjpeg.so* -rwxr-xr-x 1 root root 10964 2010-04-12 22:25 libjsig.so* -rwxr-xr-x 1 root root 260521 2010-04-12 22:25 libjsound.so* -rwxr-xr-x 1 root root 37449 2010-04-12 22:25 libmanagement.so* -rwxr-xr-x 1 root root 734280 2010-04-12 22:25 libmlib_image.so* -rwxr-xr-x 1 root root 6667 2010-04-12 22:25 libnative_chmod_g.so* -rwxr-xr-x 1 root root 6571 2010-04-12 22:25 libnative_chmod.so* -rwxr-xr-x 1 root root 111945 2010-04-12 22:25 libnet.so* -rwxr-xr-x 1 root root 43716 2010-04-12 22:25 libnio.so* -rwxr-xr-x 1 root root 15651 2010-04-12 22:25 libnpt.so* -rwxr-xr-x 1 root root 6420 2010-04-12 22:25 librmi.so* -rwxr-xr-x 1 root root 77907 2010-06-18 16:56 librxtxI2C-2.2pre1.so* -rw-r--r-- 1 root root 97530 2010-06-18 16:56 librxtxI2C.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxI2C.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxI2C.so -> librxtxI2C-2.2pre1.so* -rwxr-xr-x 1 root root 55253 2010-06-18 16:56 librxtxParallel-2.2pre1.so* -rw-r--r-- 1 root root 66164 2010-06-18 16:56 librxtxParallel.a -rwxr-xr-x 1 root root 1035 2010-06-18 16:56 librxtxParallel.la* lrwxrwxrwx 1 root root 26 2010-06-18 16:56 librxtxParallel.so -> librxtxParallel-2.2pre1.so* -rwxr-xr-x 1 root root 79049 2010-06-18 16:56 librxtxRaw-2.2pre1.so* -rw-r--r-- 1 root root 100218 2010-06-18 16:56 librxtxRaw.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxRaw.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxRaw.so -> librxtxRaw-2.2pre1.so* -rwxr-xr-x 1 root root 78134 2010-06-18 16:56 librxtxRS485-2.2pre1.so* -rw-r--r-- 1 root root 98662 2010-06-18 16:56 librxtxRS485.a -rwxr-xr-x 1 root root 1014 2010-06-18 16:56 librxtxRS485.la* lrwxrwxrwx 1 root root 23 2010-06-18 16:56 librxtxRS485.so -> librxtxRS485-2.2pre1.so* -rwxr-xr-x 1 root root 192681 2010-06-18 16:56 librxtxSerial-2.2pre1.so* -rw-r--r-- 1 root root 267524 2010-06-18 16:56 librxtxSerial.a -rwxr-xr-x 1 root root 1021 2010-06-18 16:56 librxtxSerial.la* lrwxrwxrwx 1 root root 24 2010-06-18 16:56 librxtxSerial.so -> librxtxSerial-2.2pre1.so* -rwxr-xr-x 1 root root 48036 2010-04-12 22:25 libsaproc.so* -rwxr-xr-x 1 root root 294575 2010-04-12 22:25 libsplashscreen.so* -rwxr-xr-x 1 root root 134786 2010-04-12 22:25 libunpack.so* -rwxr-xr-x 1 root root 66292 2010-04-12 22:25 libverify.so* -rwxr-xr-x 1 root root 91191 2010-04-12 22:25 libzip.so* drwxr-xr-x 2 root root 23 2010-06-18 16:41 motif21/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 native_threads/ drwxr-xr-x 2 root root 56 2010-06-18 16:41 server/ -rw------- 1 root root 0 2010-06-18 16:53 stC2p3qT -rw------- 1 root root 0 2010-06-18 16:53 stJpl8lW -rw------- 1 root root 0 2010-06-18 16:53 stnb1qWY -rw------- 1 root root 0 2010-06-18 16:53 stYjTgRS -rw------- 1 root root 0 2010-06-18 16:53 stZA8aVV drwxr-xr-x 2 root root 23 2010-06-18 16:41 xawt/ lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/ total 1300 drwxr-xr-x 2 root root 125 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ -rw-r--r-- 1 root root 8239 2010-04-12 22:08 dnsns.jar -rw-r--r-- 1 root root 842216 2010-06-10 12:45 localedata.jar -rw-r--r-- 1 root root 429 2010-04-12 22:23 meta-index -rwxr-xr-x 1 root root 61389 2010-06-18 16:56 RXTXcomm.jar* -rw-r--r-- 1 root root 170239 2010-04-12 21:58 sunjce_provider.jar -rw-r--r-- 1 root root 230608 2010-04-12 22:08 sunpkcs11.jar Help appreciated. 73 ... Sid. -- Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support Specialist, Cricket Coach Microsoft Windows Free Zone - Linux used for all Computing Tasks From Kustaa.Nyholm at planmeca.com Tue Jun 22 23:38:46 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 08:38:46 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: Message-ID: > I did change the code to > try { > z = new Zystem(); > } catch ( Exception e ) { > throw new Error(e.toString()); > }; Is there a reason why this could/should not be: > try { > z = new Zystem(); > } catch ( Throwable e ) { > e.printStackTrace(System.err); > }; From msemtd at googlemail.com Wed Jun 23 02:14:25 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:14:25 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar In-Reply-To: <4C21614B.3060504@blueyonder.co.uk> References: <4C21614B.3060504@blueyonder.co.uk> Message-ID: On 23 June 2010 02:20, Sid Boyce wrote: > slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar > RXTXcomm.jar > Failed to load Main-Class manifest attribute from > RXTXcomm.jar > Help appreciated. > 73 ... Sid. Well Sid, it's pretty obvious to me: you're trying to launch a jar that doesn't contain a main(). What exactly are you trying to achieve by running "java -jar RXTXcomm.jar"? Regards, Michael Erskine. From msemtd at googlemail.com Wed Jun 23 02:17:11 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:17:11 +0100 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: On 23 June 2010 06:38, Kustaa Nyholm wrote: > >> I did change the code to >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >> ? ? ? ? ? ? ? ?}; > > Is there a reason why this could/should not be: > > >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >> ? ? ? ? ? ? ? ?}; Or even just let the exception bubble up and kill whatever thread caused the class to load :) I vote for the removal of Zystem BTW! Regards, Michael Erskine. From george.dma at gmail.com Wed Jun 23 02:34:07 2010 From: george.dma at gmail.com (George H) Date: Wed, 23 Jun 2010 11:34:07 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: -- George H george.dma at gmail.com On Wed, Jun 23, 2010 at 11:17 AM, Michael Erskine wrote: > On 23 June 2010 06:38, Kustaa Nyholm wrote: >> >>> I did change the code to >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >>> ? ? ? ? ? ? ? ?}; >> >> Is there a reason why this could/should not be: >> >> >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >>> ? ? ? ? ? ? ? ?}; > > Or even just let the exception bubble up and kill whatever thread > caused the class to load :) > > I vote for the removal of Zystem BTW! > > Regards, > Michael Erskine. I would prefer that an exception is thrown rather than the stack trace be printed. If anyone is using loggers then it would be useful to catch the exception and log it, rather than let it come out in the error stream where no one might look. From Steffen.DETTMER at ingenico.com Wed Jun 23 03:28:45 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 11:28:45 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: <20100623092844.GF20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 08:38 +0300: > > I did change the code to > > try { > > z = new Zystem(); > > } catch ( Exception e ) { > > throw new Error(e.toString()); > > }; > > Is there a reason why this could/should not be: > > > try { > > z = new Zystem(); > > } catch ( Throwable e ) { > > e.printStackTrace(System.err); > > }; Is this intentionally not throwing the exception? Well, then it still would be discarded (althrough not neccesarily silently :)). BTW, I don't think System.err is a good idea. It is `statically initialized'? I think then this means it is unclear who the caller is and who could catch this exception. Wouldn't it be better to store the exception in a member and throw it when needing Zystem (e.g. in new or open)? 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 Kustaa.Nyholm at planmeca.com Wed Jun 23 03:55:30 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 12:55:30 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: >> Is there a reason why this could/should not be: >> >>> try { >>> z = new Zystem(); >>> } catch ( Throwable e ) { >>> e.printStackTrace(System.err); >>> }; > > Is this intentionally not throwing the exception? Well, no, just a hasty reply from my part. > still would be discarded (althrough not neccesarily silently :)). > BTW, I don't think System.err is a good idea. > > It is `statically initialized'? I think then this means it is > unclear who the caller is and who could catch this exception. > Even so re-throwing the exception would make sense so that the application developer has a chance to handle this in whichever way they want. Of course logically this should not then print the stacktrace because that is the responsibility of the application developer. But so many do not handle these cases sensibly so from the application user point of view it is nice to have something on the console to aid in trouble shooting. Have not checked the context in which this happens so that might influence my opinion. > Wouldn't it be better to store the exception in a member and > throw it when needing Zystem (e.g. in new or open) I'm of the fail-fast school of thought so I think it should be reported and re-thrown as it happens, not later. br Kusti From pietro.galassi at gmail.com Wed Jun 23 05:59:29 2010 From: pietro.galassi at gmail.com (Pietro Galassi) Date: Wed, 23 Jun 2010 13:59:29 +0200 Subject: [Rxtx] Resource temporarily unavaible on writeByte() Message-ID: Hi, i have successfully installe RXTX 64bit version from UBUNTO repository. I wrote a simple test program and it shows i have 3 ports avaible on my system: /dev/ttyS1 - Serial /dev/ttyS0 - Serial /dev/lp0 - Parallel but as soon as i try to "writeByte" any data on the parallel port it always gives me: java.io.IOException: Resource temporarily unavaible on writeByte() My simple code is: ... outputStream = parallelPort.getOutputStream() ; System.out.println("Write..."); outputStream.write(88); outputStream.flush(); outputStream.close(); ... int mode = parallelPort.getMode(); gives always 0. Anyone can help pls ? Thanks a lot, Pietro Galassi -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Jun 23 10:35:37 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 18:35:37 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: <20100623163536.GI20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 12:55 +0300: > > Wouldn't it be better to store the exception in a member and > > throw it when needing Zystem (e.g. in new or open) > > I'm of the fail-fast school of thought so I think it should be > reported and re-thrown as it happens, not later. Ahh yes, I agree, in general it is much better to fail quick, loud and verbosely, right! However, if this is a static { } block, AFAIK it is not defined when it will be executed (Before application start? Or later, when loading the class later? Or when using it first time?). If the exception would be thrown before main() is called, I think it is difficult to catch it. I think some general global hook must be used to do so. Simpler to handle, if it is thrown when invocating some function, then it can be caught by try { } catch. (or am I wrong or outdated?) 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 rbreznak at neuronrobotics.com Wed Jun 23 11:46:21 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Wed, 23 Jun 2010 13:46:21 -0400 Subject: [Rxtx] Bundling native libraries Message-ID: Hello, I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. Has anyone had experience in doing this? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Wed Jun 23 18:26:17 2010 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 23 Jun 2010 17:26:17 -0700 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Whoops, forgot to copy this to the RXTX list ... ---------- Forwarded message ---------- From: Brian Schlining Date: Wed, Jun 23, 2010 at 11:11 Subject: Re: [Rxtx] Bundling native libraries To: "Breznak, Robert" Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a > one jar. Its to the point where I have an Ant script that pulls all of the > jars together, but I haven't been able to get the native libraries to work; > They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the > user to get and use. They don't need to worry about external dependencies > and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 24 00:37:35 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 24 Jun 2010 08:37:35 +0200 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Here is a snippet from my ant file. I actually unjar the rxtx jar file and add my own classes to it for Mac and WIndows. The snippet below is actually for Mac but just for your info I am using nsis and launch4j to create an exectuable for windows. I also copy the rxtx libs to the root folder of my application: On 24.06.2010, at 02:26, Brian Schlining wrote: > Whoops, forgot to copy this to the RXTX list ... > > ---------- Forwarded message ---------- > From: Brian Schlining > Date: Wed, Jun 23, 2010 at 11:11 > Subject: Re: [Rxtx] Bundling native libraries > To: "Breznak, Robert" > > > Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc > > On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 11:29:21 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 12:29:21 -0500 Subject: [Rxtx] Port to RS422? Message-ID: Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jun 24 12:18:10 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:18:10 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Thu Jun 24 12:22:15 2010 From: showard314 at gmail.com (Scott Howard) Date: Thu, 24 Jun 2010 14:22:15 -0400 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, On Thu, Jun 24, 2010 at 1:29 PM, James, David (DJ) (SA-1) wrote: > Has anyone tried porting RxTx to RS422? Don't know for sure but . . . > If not, where is all the C code for the other implementations so that I can > give it a shot? http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code There is a file called "PORTING" in the root of rxtx-devel Also refer to the (outdated) information on: http://users.frii.com/jarvi/rxtx/porting.html which has similar information to the PORTING file (trust the PORTING file in case of conflicts) I attached a copy of that file from the 2.2pre2 release to this email. Also, see the "toy box" section: http://rxtx.qbang.org/wiki/index.php/Download for compiled downloads on other platforms good luck. ~Scott -------------- next part -------------- A non-text attachment was scrubbed... Name: PORTING Type: application/octet-stream Size: 5017 bytes Desc: not available URL: From djjames at drs-ssi.com Thu Jun 24 12:22:52 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 13:22:52 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ 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 Jun 24 12:39:42 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:39:42 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 14:10:41 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 15:10:41 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I agree with the RS422/RS485/RS232 control side being the same. Everything I have read says that this should be so. I did notice that there is a RS485 implementation within RxTx that RS485Port.java states is "Non functional". I was thinking that I could/should use the RS485 code as a basis for the RS422 code, if necessary. But this seems a rash course of action if it doesn't function. I am then trying to debug 2 sets of code, instead of working from a good set to get my "bad" set to work correctly. 1) I don't understand the first question "does your RS422 is voltage interface to RS232?" What is "is voltage"? What is an "is voltage interface"? I apologize for my ignorance about this. I have a "true" RS422 port, +/- 5 volt differential if that is what you mean. There is no cross talk between the RS232 and RS422 that I can detect. I know that the RS422 port works, from the command line I have copied a file to that tty device and see voltage changes on my scope on the transmit+ and transmit- pins. 2) No USB dongles are involved in the "badness". That said, as a test, I have run the target java code on a laptop with a USB to serial dongle and a RS232 to RS422 converter hooked to my RS422 source and the serial communications is great. I know that my messaging code is parsing the messages and that the RxTx RS232 code is getting the correct interrupts for the raw data to build the messages up from the raw data. 3) See 2). When I enumerate the ports on my Linux machine, the RS422 port shows up as a serial port. portList = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier foundPortId = null; while (portList.hasMoreElements()) { portId = (gnu.io.CommPortIdentifier) portList.nextElement(); int portType = portId.getPortType(); System.out.println("Found port " + portId.getName()); System.out.println(" of port type " + portId.getPortType()); if (portType == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { portFound = true; foundPortId = portId; } } } I hope this is the information that you requested. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:40 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Thu Jun 24 16:25:11 2010 From: jredman at ergotech.com (Jim Redman) Date: Thu, 24 Jun 2010 16:25:11 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C23DB47.5070308@ergotech.com> RS485 has a 2-wire, half-duplex mode. In this case you need a mechanism to switch sender and receiver. In many cases, the RS485 port will do this for you. Most RS232<->RS485 converters will also manage the switching in a way that is totally transparent to you. In principle, if you don't have a port that handles switching automatically for you, you could control this switching in software. Realistically, unless you have a long delay between sending and reply generation, say 100ms or more, it would be difficult. With most system, the response comes back very quickly and user level code will be too slow to manage that. I think that RS422 is always 4-wire. From the software standpoint, it, and 4-wire RS422 (and current loop and ...) all look the same. There are some electrical issues with RS422 and RS485 particularly termination. I haven't hooked up 485 or 422 in a while so I don't remember all the details, but if you get it wrong it probably won't work. Jim On 06/24/2010 12:39 PM, Mariusz Dec wrote: > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, > I have a 232 port and everything is wonderful. I set the 422 port > up similarly and see no events firing (except output buffer empty). > I set up a scope on the connector and copy a file to the port > (/dev/ttyS1 in my case) and see output. I do the same through RxTx > and see nothing. If this is a setup problem, I am confused as I set > the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so > that I can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From mariusz.dec at gmail.com Fri Jun 25 01:52:48 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 25 Jun 2010 09:52:48 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, now you are sleeping and I have the next day :) So - "voltage interface" means that you have RS232 interface and voltage level converter to use it as RS422. In such case proper work of the RS232 determines proper work of the RS422 (if hw works). In case you make tests on physically different controllers, there may be a lot of traps more, especially now, when we have milions of USB/RS232 dongles vendors and milions of not-properly-working VCP-drivers. Your sentence: "dongle and a RS232 to RS422 converter hooked to" says that you have one RS232 controller and you are using "voltage interface" named >converter< to connect to external RS422 source. It means that only problem is somewhere on the physical part of the interface. If you are seeing signals on the scope, means that you may send dat ok. if you have checked that your USB-serial dongle works good with events, look for the hw mistakes (wiring etc). If you haven't yet checked if your USB-serial dongle works good with events read this: http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html AND always remember that USB-serial dongle isn't serial COM port, this is VIRTUAL Com Port. And this may make a big difference... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t function. > I am then trying to debug 2 sets of code, instead of working from a good set > to get my ?bad? set to work correctly. > > > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on the > transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is parsing > the messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up as > a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:40 PM > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't > the same ? > > Regards > Mariusz > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Fri Jun 25 01:54:39 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 25 Jun 2010 08:54:39 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: <4C23DB47.5070308@ergotech.com> References: <4C23DB47.5070308@ergotech.com> Message-ID: I'm happily using RXTX to communicate with RS422 devices in 4-wire mode using KK-Systems K2 RS232-RS422/RS485 converters (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). Running at 115200 baud -- no issues at all. Regards, Michael Erskine. From jredman at ergotech.com Fri Jun 25 11:29:10 2010 From: jredman at ergotech.com (Jim Redman) Date: Fri, 25 Jun 2010 11:29:10 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <4C23DB47.5070308@ergotech.com> Message-ID: <4C24E766.50102@ergotech.com> Note that the K2 doesn't do automatic switching for RS485, the K2-ADE does. For true RS422 this is irrelevant. We've used a bunch of converters, including some USB versions, some from B&B (http://www.bb-elec.com/) and some (a lot?) of the non-name, low cost RS232-RS485 converters that are out there. There really is no difference as far as the software is concerned. The cabling and termination of 485/422 do tend to be more problematic, and it's likely that the problem lies there rather than anywhere else. Jim On 06/25/2010 01:54 AM, Michael Erskine wrote: > I'm happily using RXTX to communicate with RS422 devices in 4-wire > mode using KK-Systems K2 RS232-RS422/RS485 converters > (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). > Running at 115200 baud -- no issues at all. > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From robohobby at gmail.com Sun Jun 27 07:41:33 2010 From: robohobby at gmail.com (Oleg Lyubchenko) Date: Sun, 27 Jun 2010 17:41:33 +0400 Subject: [Rxtx] Is it possible to receive data from serial port, using RXTX under Linux? Message-ID: Hi, I am trying to use RxTx for a simple project. Small board ETX should communicate with several devices, using serial ports. The application should work under Linux. Java is my favorite language and that was the reason, why RXTX was selected for the task. Under Windows all was OK. But under Linux I see strange thing - It is possible to send data to the port, but it is impossible to read data from port under Linux. Lock files are OK - this part work as it should. User (the user is 'root') has permissions to read-write to port (to device). Kermit and minicom works fine with the modem. The application can send data, but can not read data. As a test example I use standard example class - TwoWaySerialComm.java . I tried both versions of this file - one version without Events and version with Events. I see the same picture with Puppy Linux, with Ubuntu 9.10, OpenSuSE 11. As a hardware I use ETX board and notebook Samsung R40. Both platforms shows the same result - can write to port, can not read from port. What I mean by "send and receive data": I do very simple test - after connection to the device I type "atz" and waiting for the answer from the modem. Normal answer should be "OK". Under Windows, using "TwoWaySerialComm" I see : ATZ ATZ OK Under Linux I see only ATZ ATZ (No normal answer 'OK') Any ideas? PS: If you want to see the code, you can download the code of the project from http://www.robohobby.com/downloads/JavaRxTx.zip There is nothing special there - just project for Netbeans with code of two standard examples. to run it under Windows, use JavaRxTx\r.bat for Linux, use JavaRxTx\sh r.sh Sincerely, Oleg -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at iDIAcomputing.com Sun Jun 27 08:16:25 2010 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 27 Jun 2010 10:16:25 -0400 Subject: [Rxtx] Is it possible to receive data from serial port, using RXTX under Linux? In-Reply-To: References: Message-ID: <4C275D39.3060005@iDIAcomputing.com> Oleg On 6/27/10 9:41 AM, Oleg Lyubchenko wrote: > Under Windows, using "TwoWaySerialComm" I see : > ATZ > ATZ > OK > > Under Linux > I see only > ATZ > ATZ > > (No normal answer 'OK') > > Any ideas? > > PS: If you want to see the code, you can download the code of the > project from > http://www.robohobby.com/downloads/JavaRxTx.zip > There is nothing special there - just project for Netbeans with code of > two standard examples. > > to run it under Windows, use > JavaRxTx\r.bat > for Linux, use JavaRxTx\sh r.sh Oleg, I've not looked at your code, but are you sending both a carriage return and a linefeed to the modem? Windows will generally send both for a \n but Linux will generally only send a linefeed. You may need to use \r\n to get both. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From djjames at drs-ssi.com Mon Jun 28 07:40:32 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Mon, 28 Jun 2010 08:40:32 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: All, I have a box that has RS422 native, the sender of some data. I have another box that has RS422 native. My software runs on this machine. This is where my problem lies. I think I confused the issue with my statement about the 422/232 converter. I have the converter in my test setup to make certain that the sender was sending what I expected, hooked to a laptop with hyperterm. The production setup will have no converters. It cannot have a converter. I have another box on which I have to communicate via RS232. I have that communications up and running. I get the correct information out of my RS232 link. +------+ RS422 +----+ RS232 +-------+ |Sender|-------| Me |-------|Another| +------+ +----+ | Sender| +-------+ On the scope, I have verified that the RS422 sender is setting the transmit lines correctly. I cannot get my side of the RS422 communications to work. I have set my RS422 configuration to be similar to the RS232 that does work. The only event that I am getting is output buffer empty, even though I have turned off that notification (422port.notifyOnOutputEmpty(false);). I have 422port.notifyOnDataAvilable(true), yet I never get that event. It doesn't seem that I have things setup correctly. I have configured the RS422 port per my interface spec with the RS422 sender, yet I don't get any data (no data available events!). If I can't get this to work, I will be writing my own (which isn't a nice thought). From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Friday, June 25, 2010 2:53 AM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, now you are sleeping and I have the next day :) So - "voltage interface" means that you have RS232 interface and voltage level converter to use it as RS422. In such case proper work of the RS232 determines proper work of the RS422 (if hw works). In case you make tests on physically different controllers, there may be a lot of traps more, especially now, when we have milions of USB/RS232 dongles vendors and milions of not-properly-working VCP-drivers. Your sentence: "dongle and a RS232 to RS422 converter hooked to" says that you have one RS232 controller and you are using "voltage interface" named >converter< to connect to external RS422 source. It means that only problem is somewhere on the physical part of the interface. If you are seeing signals on the scope, means that you may send dat ok. if you have checked that your USB-serial dongle works good with events, look for the hw mistakes (wiring etc). If you haven't yet checked if your USB-serial dongle works good with events read this: http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html AND always remember that USB-serial dongle isn't serial COM port, this is VIRTUAL Com Port. And this may make a big difference... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I agree with the RS422/RS485/RS232 control side being the same. Everything I have read says that this should be so. I did notice that there is a RS485 implementation within RxTx that RS485Port.java states is "Non functional". I was thinking that I could/should use the RS485 code as a basis for the RS422 code, if necessary. But this seems a rash course of action if it doesn't function. I am then trying to debug 2 sets of code, instead of working from a good set to get my "bad" set to work correctly. 1) I don't understand the first question "does your RS422 is voltage interface to RS232?" What is "is voltage"? What is an "is voltage interface"? I apologize for my ignorance about this. I have a "true" RS422 port, +/- 5 volt differential if that is what you mean. There is no cross talk between the RS232 and RS422 that I can detect. I know that the RS422 port works, from the command line I have copied a file to that tty device and see voltage changes on my scope on the transmit+ and transmit- pins. 2) No USB dongles are involved in the "badness". That said, as a test, I have run the target java code on a laptop with a USB to serial dongle and a RS232 to RS422 converter hooked to my RS422 source and the serial communications is great. I know that my messaging code is parsing the messages and that the RxTx RS232 code is getting the correct interrupts for the raw data to build the messages up from the raw data. 3) See 2). When I enumerate the ports on my Linux machine, the RS422 port shows up as a serial port. portList = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier foundPortId = null; while (portList.hasMoreElements()) { portId = (gnu.io.CommPortIdentifier) portList.nextElement(); int portType = portId.getPortType(); System.out.println("Found port " + portId.getName()); System.out.println(" of port type " + portId.getPortType()); if (portType == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { portFound = true; foundPortId = portId; } } } I hope this is the information that you requested. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:40 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From leo.guimaraes at gmail.com Fri Jun 18 13:29:14 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Fri, 18 Jun 2010 15:29:14 -0400 Subject: [Rxtx] Virtual Port with RXTX Message-ID: Hello everybody, Please, im crazy trying to solve this problem: I created a virtual port in my server to receive data over the ethernet from a serial port in the client machine. Im using socat for that: In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: 192.168.102.41:54321 its working fine for me, accessing the virtual port via CuteCom or any terminal. But i can't access this port via RXTX. The getPortIdentifiers() method returns only the /dev/ttyS0 port. Please guys, could you help me about that? Thank you very much! Leandro Guimar?es -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Fri Jun 18 23:43:50 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 19 Jun 2010 07:43:50 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: Hi, In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: > 192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or any > terminal. But i can't access this port via RXTX. The getPortIdentifiers() > method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock Try to change name of the virtual port. I suppose you are using Linux, so: In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid prefixes for the Linux com ports. Add your prefix there or change your VCP name to match to any predefined prefix there. Regards Mariusz > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Sat Jun 19 08:03:06 2010 From: jredman at ergotech.com (Jim Redman) Date: Sat, 19 Jun 2010 08:03:06 -0600 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: <4C1CCE1A.90201@ergotech.com> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports so: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 or whatever you need for the virtual port. The ports will enumerate in the order give (I don't know whether this is a guaranteed behavior or just the way it happens to be). Jim On 06/18/2010 11:43 PM, Mariusz Dec wrote: > Hi, > > In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > tcp:192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or > any terminal. But i can't access this port via RXTX. The > getPortIdentifiers() method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork > file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > > Try to change name of the virtual port. > > I suppose you are using Linux, so: > > In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > prefixes for the Linux com ports. > Add your prefix there or change your VCP name to match to any predefined > prefix there. > > Regards > Mariusz > > > > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From leo.guimaraes at gmail.com Mon Jun 21 13:23:26 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 16:23:26 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: <4C1CCE1A.90201@ergotech.com> References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hello, Change my virtual port to ttySXX worked fine... But now, im having another problem... I dont know why, but the virtual port is never calling the SerialEvent in the SerialPortEventListenner... using the real Serial port, works fine. But it doesnt work with the virtual port... Somebody have an idea?? Pleasse! Thank you!! Leandro Guimar?es On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: > You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > so: > > > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > > or whatever you need for the virtual port. The ports will enumerate in the > order give (I don't know whether this is a guaranteed behavior or just the > way it happens to be). > > Jim > > > > > On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> Hi, >> >> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave >> tcp:192.168.102.41:54321 >> >> >> its working fine for me, accessing the virtual port via CuteCom or >> any terminal. But i can't access this port via RXTX. The >> getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >> Please guys, could you help me about that? >> >> >> In client machine: socat tcp-l:54321,reuseaddr,fork >> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >> Try to change name of the virtual port. >> >> I suppose you are using Linux, so: >> >> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> prefixes for the Linux com ports. >> Add your prefix there or change your VCP name to match to any predefined >> prefix there. >> >> Regards >> Mariusz >> >> >> >> Thank you very much! >> Leandro Guimar?es >> >> >> _______________________________________________ >> 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 >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > > _______________________________________________ > 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 Mon Jun 21 13:47:13 2010 From: george.dma at gmail.com (George H) Date: Mon, 21 Jun 2010 19:47:13 +0000 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, This might be because it is a virtual port. I used to do testing on usb/serial port and there were some "signals" it would not send me that a real serial port would. Try to see what signals your serial port sends you that the virtual port doesn't. I think there are some serial port sniffers out there where you can intercept the signals. Also would do good if you look at some technical tutorials on how serial port signals work. A good site which I read over many times to try to understand why things are the way they are is http://www.arcelect.com/rs232.htm I hope this gave you some ideas. Good luck -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Hello, > > ?? Change my virtual port to ttySXX worked fine... > > ?? But now, im having another problem... > > ? I dont know why, but the virtual port is never calling the SerialEvent in > the SerialPortEventListenner... using the real Serial port, works fine. But > it doesnt work with the virtual port... > > > ?? Somebody have an idea?? Pleasse! > > Thank you!! > Leandro Guimar?es > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports >> so: >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> the order give (I don't know whether this is a guaranteed behavior or just >> the way it happens to be). >> >> Jim >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >>> >>> Hi, >>> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >>> ? ?tcp:192.168.102.41:54321 >>> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >>> ? ?any terminal. But i can't access this port via RXTX. The >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >>> >>> ? ? ? Please guys, could you help me about that? >>> >>> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >>> >>> Try to change name of the virtual port. >>> >>> I suppose you are using Linux, so: >>> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >>> prefixes for the Linux com ports. >>> Add your prefix there or change your VCP name to match to any predefined >>> prefix there. >>> >>> Regards >>> Mariusz >>> >>> >>> >>> ? ?Thank you very much! >>> ? ?Leandro Guimar?es >>> >>> >>> ? ?_______________________________________________ >>> ? ?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 >> >> -- >> Jim Redman >> (505) 662 5156 x85 >> http://www.ergotech.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From leo.guimaraes at gmail.com Mon Jun 21 14:56:15 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 17:56:15 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Thanks George, Please, do you know what represents a "data available" in RXTX? Wich signal calls the Listener's Notify? Its the last thing that i need to do to finish my project here! Thank you very much! Leandro Guimar?es 2010/6/21 George H > Hi, > > This might be because it is a virtual port. > I used to do testing on usb/serial port and there were some "signals" > it would not send me that a real serial port would. > Try to see what signals your serial port sends you that the virtual > port doesn't. I think there are some serial port sniffers out there > where you can intercept the signals. Also would do good if you look at > some technical tutorials on how serial port signals work. > > A good site which I read over many times to try to understand why > things are the way they are is http://www.arcelect.com/rs232.htm > > I hope this gave you some ideas. > Good luck > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Hello, > > > > Change my virtual port to ttySXX worked fine... > > > > But now, im having another problem... > > > > I dont know why, but the virtual port is never calling the SerialEvent > in > > the SerialPortEventListenner... using the real Serial port, works fine. > But > > it doesnt work with the virtual port... > > > > > > Somebody have an idea?? Pleasse! > > > > Thank you!! > > Leandro Guimar?es > > > > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > wrote: > >> > >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > >> so: > >> > >> > >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> > >> or whatever you need for the virtual port. The ports will enumerate in > >> the order give (I don't know whether this is a guaranteed behavior or > just > >> the way it happens to be). > >> > >> Jim > >> > >> > >> > >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >>> > >>> Hi, > >>> > >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >>> tcp:192.168.102.41:54321 > >>> > >>> its working fine for me, accessing the virtual port via CuteCom or > >>> any terminal. But i can't access this port via RXTX. The > >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >>> > >>> Please guys, could you help me about that? > >>> > >>> > >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >>> > >>> Try to change name of the virtual port. > >>> > >>> I suppose you are using Linux, so: > >>> > >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >>> prefixes for the Linux com ports. > >>> Add your prefix there or change your VCP name to match to any > predefined > >>> prefix there. > >>> > >>> Regards > >>> Mariusz > >>> > >>> > >>> > >>> Thank you very much! > >>> Leandro Guimar?es > >>> > >>> > >>> _______________________________________________ > >>> 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 > >> > >> -- > >> Jim Redman > >> (505) 662 5156 x85 > >> http://www.ergotech.com > >> _______________________________________________ > >> 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 george.dma at gmail.com Mon Jun 21 22:51:50 2010 From: george.dma at gmail.com (George H) Date: Tue, 22 Jun 2010 07:51:50 +0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Did you read the site I posted? If you did you would have figured out which pin signal on the RS232 interface most likely triggers the data available event. It might be pin 2 and it might be pin 3, depends what kind of serial port you have and the cable. Plus i'm no expert on on RS-232 interfaces, I just know that if I have my hardware in front of me, and the source code of rxtx and a rs-232 specifications sheet then I can debug the problem and find out. This is what I believe you should do to get started to find out the "what, where and why" of your problem. -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Thanks George, > > ?? Please, do you know what represents a "data available" in RXTX? Wich > signal calls the Listener's Notify? > > ?? Its the last thing that i need to do to finish my project here! > > Thank you very much! > > Leandro Guimar?es > > > 2010/6/21 George H >> >> Hi, >> >> This might be because it is a virtual port. >> I used to do testing on usb/serial port and there were some "signals" >> it would not send me that a real serial port would. >> Try to see what signals your serial port sends you that the virtual >> port doesn't. I think there are some serial port sniffers out there >> where you can intercept the signals. Also would do good if you look at >> some technical tutorials on how serial port signals work. >> >> A good site which I read over many times to try to understand why >> things are the way they are is http://www.arcelect.com/rs232.htm >> >> I hope this gave you some ideas. >> Good luck >> -- >> George H >> george.dma at gmail.com >> >> >> >> 2010/6/21 Leandro Guimar?es : >> > Hello, >> > >> > ?? Change my virtual port to ttySXX worked fine... >> > >> > ?? But now, im having another problem... >> > >> > ? I dont know why, but the virtual port is never calling the SerialEvent >> > in >> > the SerialPortEventListenner... using the real Serial port, works fine. >> > But >> > it doesnt work with the virtual port... >> > >> > >> > ?? Somebody have an idea?? Pleasse! >> > >> > Thank you!! >> > Leandro Guimar?es >> > >> > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman >> > wrote: >> >> >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of >> >> ports >> >> so: >> >> >> >> >> >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> >> the order give (I don't know whether this is a guaranteed behavior or >> >> just >> >> the way it happens to be). >> >> >> >> Jim >> >> >> >> >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >> >>> >> >>> Hi, >> >>> >> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >> >>> ? ?tcp:192.168.102.41:54321 >> >>> >> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >> >>> ? ?any terminal. But i can't access this port via RXTX. The >> >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >>> >> >>> ? ? ? Please guys, could you help me about that? >> >>> >> >>> >> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >>> >> >>> Try to change name of the virtual port. >> >>> >> >>> I suppose you are using Linux, so: >> >>> >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> >>> prefixes for the Linux com ports. >> >>> Add your prefix there or change your VCP name to match to any >> >>> predefined >> >>> prefix there. >> >>> >> >>> Regards >> >>> Mariusz >> >>> >> >>> >> >>> >> >>> ? ?Thank you very much! >> >>> ? ?Leandro Guimar?es >> >>> >> >>> >> >>> ? ?_______________________________________________ >> >>> ? ?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 >> >> >> >> -- >> >> Jim Redman >> >> (505) 662 5156 x85 >> >> http://www.ergotech.com >> >> _______________________________________________ >> >> Rxtx mailing list >> >> Rxtx at qbang.org >> >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > >> > _______________________________________________ >> > Rxtx mailing list >> > Rxtx at qbang.org >> > http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > > > From mariusz.dec at gmail.com Tue Jun 22 05:32:01 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 22 Jun 2010 13:32:01 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, I am working with virtual ports only. Because of some problems with events I have changed whole idea. I did a thread in Java which is looking for port data in pool. If data comes in, I parse it and than generate an Java exception for the application. This works very good from several months and has an advantage more - is faster than events services. I have published many times an example code. Look for 2009'november thread "RXTX close() problem solved". In this example you can set Exception generation in read thread. There is a lot of "try-catch" loops which prevents system while you disconnect USB as well. For me works very good in Mac/Linux and Windows. Regards Mariusz 2010/6/22 George H > Did you read the site I posted? If you did you would have figured out > which pin signal on the RS232 interface most likely triggers the data > available event. > It might be pin 2 and it might be pin 3, depends what kind of serial > port you have and the cable. > > Plus i'm no expert on on RS-232 interfaces, I just know that if I have > my hardware in front of me, and the source code of rxtx and a rs-232 > specifications sheet then I can debug the problem and find out. This > is what I believe you should do to get started to find out the "what, > where and why" of your problem. > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Thanks George, > > > > Please, do you know what represents a "data available" in RXTX? Wich > > signal calls the Listener's Notify? > > > > Its the last thing that i need to do to finish my project here! > > > > Thank you very much! > > > > Leandro Guimar?es > > > > > > 2010/6/21 George H > >> > >> Hi, > >> > >> This might be because it is a virtual port. > >> I used to do testing on usb/serial port and there were some "signals" > >> it would not send me that a real serial port would. > >> Try to see what signals your serial port sends you that the virtual > >> port doesn't. I think there are some serial port sniffers out there > >> where you can intercept the signals. Also would do good if you look at > >> some technical tutorials on how serial port signals work. > >> > >> A good site which I read over many times to try to understand why > >> things are the way they are is http://www.arcelect.com/rs232.htm > >> > >> I hope this gave you some ideas. > >> Good luck > >> -- > >> George H > >> george.dma at gmail.com > >> > >> > >> > >> 2010/6/21 Leandro Guimar?es : > >> > Hello, > >> > > >> > Change my virtual port to ttySXX worked fine... > >> > > >> > But now, im having another problem... > >> > > >> > I dont know why, but the virtual port is never calling the > SerialEvent > >> > in > >> > the SerialPortEventListenner... using the real Serial port, works > fine. > >> > But > >> > it doesnt work with the virtual port... > >> > > >> > > >> > Somebody have an idea?? Pleasse! > >> > > >> > Thank you!! > >> > Leandro Guimar?es > >> > > >> > > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > >> > wrote: > >> >> > >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of > >> >> ports > >> >> so: > >> >> > >> >> > >> >> > >> >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> >> > >> >> or whatever you need for the virtual port. The ports will enumerate > in > >> >> the order give (I don't know whether this is a guaranteed behavior or > >> >> just > >> >> the way it happens to be). > >> >> > >> >> Jim > >> >> > >> >> > >> >> > >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> >>> > >> >>> Hi, > >> >>> > >> >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >> >>> tcp:192.168.102.41:54321 > >> >>> > >> >>> its working fine for me, accessing the virtual port via CuteCom > or > >> >>> any terminal. But i can't access this port via RXTX. The > >> >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >> >>> > >> >>> Please guys, could you help me about that? > >> >>> > >> >>> > >> >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >> >>> > >> >>> Try to change name of the virtual port. > >> >>> > >> >>> I suppose you are using Linux, so: > >> >>> > >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >> >>> prefixes for the Linux com ports. > >> >>> Add your prefix there or change your VCP name to match to any > >> >>> predefined > >> >>> prefix there. > >> >>> > >> >>> Regards > >> >>> Mariusz > >> >>> > >> >>> > >> >>> > >> >>> Thank you very much! > >> >>> Leandro Guimar?es > >> >>> > >> >>> > >> >>> _______________________________________________ > >> >>> 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 > >> >> > >> >> -- > >> >> Jim Redman > >> >> (505) 662 5156 x85 > >> >> http://www.ergotech.com > >> >> _______________________________________________ > >> >> 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 > >> > > >> > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Tue Jun 22 07:20:17 2010 From: showard314 at gmail.com (Scott Howard) Date: Tue, 22 Jun 2010 09:20:17 -0400 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails Message-ID: This is forwarded from: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472053 by Jan Niehusmann I tried putting this on the bug tracker but I couldn't get access In the static initializer of gnu.io.RXTXPort, an exception when initializing the static variable 'z' is silently discarded: try { z = new Zystem(); } catch ( Exception e ) {}; This leads to NullPointerExceptions later, which are difficult to debug as the original exception is lost. I did change the code to try { z = new Zystem(); } catch ( Exception e ) { throw new Error(e.toString()); }; for debugging. Probably a more specific exception would be more appropriate, but the point is that leaving z undefined without reporting an error makes debugging unnecessarily difficult. Thanks. From g3vbv at blueyonder.co.uk Tue Jun 22 19:20:11 2010 From: g3vbv at blueyonder.co.uk (Sid Boyce) Date: Wed, 23 Jun 2010 02:20:11 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar Message-ID: <4C21614B.3060504@blueyonder.co.uk> I am using openSUSE 11.3 RC1. "rfcomm -a" lists no devices From dmesg =========== [288811.093151] usb 2-4.4.2: new full speed USB device using ehci_hcd and address 16 [288811.207421] usb 2-4.4.2: New USB device found, idVendor=0403, idProduct=6001 [288811.207431] usb 2-4.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [288811.207438] usb 2-4.4.2: Product: FT232R USB UART [288811.207443] usb 2-4.4.2: Manufacturer: FTDI [288811.207447] usb 2-4.4.2: SerialNumber: A100efz7 [288811.210509] ftdi_sio 2-4.4.2:1.0: FTDI USB Serial Device converter detected [288811.210534] usb 2-4.4.2: Detected FT232RL [288811.210536] usb 2-4.4.2: Number of endpoints 2 [288811.210538] usb 2-4.4.2: Endpoint 1 MaxPacketSize 64 [288811.210540] usb 2-4.4.2: Endpoint 2 MaxPacketSize 64 [288811.210541] usb 2-4.4.2: Setting MaxPacketSize 64 [288811.210822] usb 2-4.4.2: FTDI USB Serial Device converter now attached to ttyUSB1 Package built and installed OK in /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/amd64, it also installed /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/RXTXcomm.jar slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar RXTXcomm.jar Failed to load Main-Class manifest attribute from RXTXcomm.jar # rpm -qa |grep java java-1_6_0-sun-1.6.0.u20-1.15.x86_64 gcc44-java-4.4.2_20100116-1.2.x86_64 netbeans-javaparser-6.8-1.1.noarch gcc45-java-4.5.0_20100604-1.1.x86_64 ant-javadoc-1.7.1-11.1.noarch javahelp2-2.0.05-6.28.noarch gcc43-java-4.3.4_20091019-2.25.x86_64 gcc-java-4.5-5.2.x86_64 java-ca-certificates-1-5.1.noarch java-1_6_0-sun-devel-1.6.0.u20-1.15.x86_64 lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> echo $JAVA_HOME /usr/lib64/jvm/java-1.6.0-sun-1.6.0 > l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/amd64/ total 6440 drwxr-xr-x 8 root root 4096 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ drwxr-xr-x 2 root root 23 2010-06-18 16:41 headless/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 jli/ -rw-r--r-- 1 root root 652 2010-04-12 22:00 jvm.cfg -rwxr-xr-x 1 root root 15836 2010-04-12 22:25 libattach.so* -rwxr-xr-x 1 root root 757091 2010-04-12 22:25 libawt.so* -rwxr-xr-x 1 root root 413267 2010-04-12 22:25 libcmm.so* -rwxr-xr-x 1 root root 217736 2010-04-12 22:25 libdcpr.so* -rwxr-xr-x 1 root root 120029 2010-04-12 22:30 libdeploy.so* -rwxr-xr-x 1 root root 21670 2010-04-12 22:25 libdt_socket.so* -rwxr-xr-x 1 root root 692649 2010-04-12 22:25 libfontmanager.so* -rwxr-xr-x 1 root root 237073 2010-04-12 22:25 libhprof.so* -rwxr-xr-x 1 root root 50085 2010-04-12 22:25 libinstrument.so* -rwxr-xr-x 1 root root 27244 2010-04-12 22:25 libioser12.so* -rwxr-xr-x 1 root root 46723 2010-04-12 22:25 libj2gss.so* -rwxr-xr-x 1 root root 14272 2010-04-12 22:25 libj2pcsc.so* -rwxr-xr-x 1 root root 78017 2010-04-12 22:25 libj2pkcs11.so* -rwxr-xr-x 1 root root 7980 2010-04-12 22:25 libjaas_unix.so* -rwxr-xr-x 1 root root 28919 2010-04-12 22:25 libjava_crw_demo.so* -rwxr-xr-x 1 root root 231135 2010-04-12 22:25 libjava.so* -rwxr-xr-x 1 root root 7099 2010-04-12 22:25 libjawt.so* -rwxr-xr-x 1 root root 293725 2010-04-12 22:25 libjdwp.so* -rwxr-xr-x 1 root root 224947 2010-04-12 22:25 libjpeg.so* -rwxr-xr-x 1 root root 10964 2010-04-12 22:25 libjsig.so* -rwxr-xr-x 1 root root 260521 2010-04-12 22:25 libjsound.so* -rwxr-xr-x 1 root root 37449 2010-04-12 22:25 libmanagement.so* -rwxr-xr-x 1 root root 734280 2010-04-12 22:25 libmlib_image.so* -rwxr-xr-x 1 root root 6667 2010-04-12 22:25 libnative_chmod_g.so* -rwxr-xr-x 1 root root 6571 2010-04-12 22:25 libnative_chmod.so* -rwxr-xr-x 1 root root 111945 2010-04-12 22:25 libnet.so* -rwxr-xr-x 1 root root 43716 2010-04-12 22:25 libnio.so* -rwxr-xr-x 1 root root 15651 2010-04-12 22:25 libnpt.so* -rwxr-xr-x 1 root root 6420 2010-04-12 22:25 librmi.so* -rwxr-xr-x 1 root root 77907 2010-06-18 16:56 librxtxI2C-2.2pre1.so* -rw-r--r-- 1 root root 97530 2010-06-18 16:56 librxtxI2C.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxI2C.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxI2C.so -> librxtxI2C-2.2pre1.so* -rwxr-xr-x 1 root root 55253 2010-06-18 16:56 librxtxParallel-2.2pre1.so* -rw-r--r-- 1 root root 66164 2010-06-18 16:56 librxtxParallel.a -rwxr-xr-x 1 root root 1035 2010-06-18 16:56 librxtxParallel.la* lrwxrwxrwx 1 root root 26 2010-06-18 16:56 librxtxParallel.so -> librxtxParallel-2.2pre1.so* -rwxr-xr-x 1 root root 79049 2010-06-18 16:56 librxtxRaw-2.2pre1.so* -rw-r--r-- 1 root root 100218 2010-06-18 16:56 librxtxRaw.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxRaw.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxRaw.so -> librxtxRaw-2.2pre1.so* -rwxr-xr-x 1 root root 78134 2010-06-18 16:56 librxtxRS485-2.2pre1.so* -rw-r--r-- 1 root root 98662 2010-06-18 16:56 librxtxRS485.a -rwxr-xr-x 1 root root 1014 2010-06-18 16:56 librxtxRS485.la* lrwxrwxrwx 1 root root 23 2010-06-18 16:56 librxtxRS485.so -> librxtxRS485-2.2pre1.so* -rwxr-xr-x 1 root root 192681 2010-06-18 16:56 librxtxSerial-2.2pre1.so* -rw-r--r-- 1 root root 267524 2010-06-18 16:56 librxtxSerial.a -rwxr-xr-x 1 root root 1021 2010-06-18 16:56 librxtxSerial.la* lrwxrwxrwx 1 root root 24 2010-06-18 16:56 librxtxSerial.so -> librxtxSerial-2.2pre1.so* -rwxr-xr-x 1 root root 48036 2010-04-12 22:25 libsaproc.so* -rwxr-xr-x 1 root root 294575 2010-04-12 22:25 libsplashscreen.so* -rwxr-xr-x 1 root root 134786 2010-04-12 22:25 libunpack.so* -rwxr-xr-x 1 root root 66292 2010-04-12 22:25 libverify.so* -rwxr-xr-x 1 root root 91191 2010-04-12 22:25 libzip.so* drwxr-xr-x 2 root root 23 2010-06-18 16:41 motif21/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 native_threads/ drwxr-xr-x 2 root root 56 2010-06-18 16:41 server/ -rw------- 1 root root 0 2010-06-18 16:53 stC2p3qT -rw------- 1 root root 0 2010-06-18 16:53 stJpl8lW -rw------- 1 root root 0 2010-06-18 16:53 stnb1qWY -rw------- 1 root root 0 2010-06-18 16:53 stYjTgRS -rw------- 1 root root 0 2010-06-18 16:53 stZA8aVV drwxr-xr-x 2 root root 23 2010-06-18 16:41 xawt/ lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/ total 1300 drwxr-xr-x 2 root root 125 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ -rw-r--r-- 1 root root 8239 2010-04-12 22:08 dnsns.jar -rw-r--r-- 1 root root 842216 2010-06-10 12:45 localedata.jar -rw-r--r-- 1 root root 429 2010-04-12 22:23 meta-index -rwxr-xr-x 1 root root 61389 2010-06-18 16:56 RXTXcomm.jar* -rw-r--r-- 1 root root 170239 2010-04-12 21:58 sunjce_provider.jar -rw-r--r-- 1 root root 230608 2010-04-12 22:08 sunpkcs11.jar Help appreciated. 73 ... Sid. -- Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support Specialist, Cricket Coach Microsoft Windows Free Zone - Linux used for all Computing Tasks From Kustaa.Nyholm at planmeca.com Tue Jun 22 23:38:46 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 08:38:46 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: Message-ID: > I did change the code to > try { > z = new Zystem(); > } catch ( Exception e ) { > throw new Error(e.toString()); > }; Is there a reason why this could/should not be: > try { > z = new Zystem(); > } catch ( Throwable e ) { > e.printStackTrace(System.err); > }; From msemtd at googlemail.com Wed Jun 23 02:14:25 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:14:25 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar In-Reply-To: <4C21614B.3060504@blueyonder.co.uk> References: <4C21614B.3060504@blueyonder.co.uk> Message-ID: On 23 June 2010 02:20, Sid Boyce wrote: > slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar > RXTXcomm.jar > Failed to load Main-Class manifest attribute from > RXTXcomm.jar > Help appreciated. > 73 ... Sid. Well Sid, it's pretty obvious to me: you're trying to launch a jar that doesn't contain a main(). What exactly are you trying to achieve by running "java -jar RXTXcomm.jar"? Regards, Michael Erskine. From msemtd at googlemail.com Wed Jun 23 02:17:11 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:17:11 +0100 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: On 23 June 2010 06:38, Kustaa Nyholm wrote: > >> I did change the code to >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >> ? ? ? ? ? ? ? ?}; > > Is there a reason why this could/should not be: > > >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >> ? ? ? ? ? ? ? ?}; Or even just let the exception bubble up and kill whatever thread caused the class to load :) I vote for the removal of Zystem BTW! Regards, Michael Erskine. From george.dma at gmail.com Wed Jun 23 02:34:07 2010 From: george.dma at gmail.com (George H) Date: Wed, 23 Jun 2010 11:34:07 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: -- George H george.dma at gmail.com On Wed, Jun 23, 2010 at 11:17 AM, Michael Erskine wrote: > On 23 June 2010 06:38, Kustaa Nyholm wrote: >> >>> I did change the code to >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >>> ? ? ? ? ? ? ? ?}; >> >> Is there a reason why this could/should not be: >> >> >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >>> ? ? ? ? ? ? ? ?}; > > Or even just let the exception bubble up and kill whatever thread > caused the class to load :) > > I vote for the removal of Zystem BTW! > > Regards, > Michael Erskine. I would prefer that an exception is thrown rather than the stack trace be printed. If anyone is using loggers then it would be useful to catch the exception and log it, rather than let it come out in the error stream where no one might look. From Steffen.DETTMER at ingenico.com Wed Jun 23 03:28:45 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 11:28:45 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: <20100623092844.GF20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 08:38 +0300: > > I did change the code to > > try { > > z = new Zystem(); > > } catch ( Exception e ) { > > throw new Error(e.toString()); > > }; > > Is there a reason why this could/should not be: > > > try { > > z = new Zystem(); > > } catch ( Throwable e ) { > > e.printStackTrace(System.err); > > }; Is this intentionally not throwing the exception? Well, then it still would be discarded (althrough not neccesarily silently :)). BTW, I don't think System.err is a good idea. It is `statically initialized'? I think then this means it is unclear who the caller is and who could catch this exception. Wouldn't it be better to store the exception in a member and throw it when needing Zystem (e.g. in new or open)? 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 Kustaa.Nyholm at planmeca.com Wed Jun 23 03:55:30 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 12:55:30 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: >> Is there a reason why this could/should not be: >> >>> try { >>> z = new Zystem(); >>> } catch ( Throwable e ) { >>> e.printStackTrace(System.err); >>> }; > > Is this intentionally not throwing the exception? Well, no, just a hasty reply from my part. > still would be discarded (althrough not neccesarily silently :)). > BTW, I don't think System.err is a good idea. > > It is `statically initialized'? I think then this means it is > unclear who the caller is and who could catch this exception. > Even so re-throwing the exception would make sense so that the application developer has a chance to handle this in whichever way they want. Of course logically this should not then print the stacktrace because that is the responsibility of the application developer. But so many do not handle these cases sensibly so from the application user point of view it is nice to have something on the console to aid in trouble shooting. Have not checked the context in which this happens so that might influence my opinion. > Wouldn't it be better to store the exception in a member and > throw it when needing Zystem (e.g. in new or open) I'm of the fail-fast school of thought so I think it should be reported and re-thrown as it happens, not later. br Kusti From pietro.galassi at gmail.com Wed Jun 23 05:59:29 2010 From: pietro.galassi at gmail.com (Pietro Galassi) Date: Wed, 23 Jun 2010 13:59:29 +0200 Subject: [Rxtx] Resource temporarily unavaible on writeByte() Message-ID: Hi, i have successfully installe RXTX 64bit version from UBUNTO repository. I wrote a simple test program and it shows i have 3 ports avaible on my system: /dev/ttyS1 - Serial /dev/ttyS0 - Serial /dev/lp0 - Parallel but as soon as i try to "writeByte" any data on the parallel port it always gives me: java.io.IOException: Resource temporarily unavaible on writeByte() My simple code is: ... outputStream = parallelPort.getOutputStream() ; System.out.println("Write..."); outputStream.write(88); outputStream.flush(); outputStream.close(); ... int mode = parallelPort.getMode(); gives always 0. Anyone can help pls ? Thanks a lot, Pietro Galassi -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Jun 23 10:35:37 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 18:35:37 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: <20100623163536.GI20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 12:55 +0300: > > Wouldn't it be better to store the exception in a member and > > throw it when needing Zystem (e.g. in new or open) > > I'm of the fail-fast school of thought so I think it should be > reported and re-thrown as it happens, not later. Ahh yes, I agree, in general it is much better to fail quick, loud and verbosely, right! However, if this is a static { } block, AFAIK it is not defined when it will be executed (Before application start? Or later, when loading the class later? Or when using it first time?). If the exception would be thrown before main() is called, I think it is difficult to catch it. I think some general global hook must be used to do so. Simpler to handle, if it is thrown when invocating some function, then it can be caught by try { } catch. (or am I wrong or outdated?) 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 rbreznak at neuronrobotics.com Wed Jun 23 11:46:21 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Wed, 23 Jun 2010 13:46:21 -0400 Subject: [Rxtx] Bundling native libraries Message-ID: Hello, I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. Has anyone had experience in doing this? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Wed Jun 23 18:26:17 2010 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 23 Jun 2010 17:26:17 -0700 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Whoops, forgot to copy this to the RXTX list ... ---------- Forwarded message ---------- From: Brian Schlining Date: Wed, Jun 23, 2010 at 11:11 Subject: Re: [Rxtx] Bundling native libraries To: "Breznak, Robert" Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a > one jar. Its to the point where I have an Ant script that pulls all of the > jars together, but I haven't been able to get the native libraries to work; > They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the > user to get and use. They don't need to worry about external dependencies > and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 24 00:37:35 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 24 Jun 2010 08:37:35 +0200 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Here is a snippet from my ant file. I actually unjar the rxtx jar file and add my own classes to it for Mac and WIndows. The snippet below is actually for Mac but just for your info I am using nsis and launch4j to create an exectuable for windows. I also copy the rxtx libs to the root folder of my application: On 24.06.2010, at 02:26, Brian Schlining wrote: > Whoops, forgot to copy this to the RXTX list ... > > ---------- Forwarded message ---------- > From: Brian Schlining > Date: Wed, Jun 23, 2010 at 11:11 > Subject: Re: [Rxtx] Bundling native libraries > To: "Breznak, Robert" > > > Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc > > On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 11:29:21 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 12:29:21 -0500 Subject: [Rxtx] Port to RS422? Message-ID: Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jun 24 12:18:10 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:18:10 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Thu Jun 24 12:22:15 2010 From: showard314 at gmail.com (Scott Howard) Date: Thu, 24 Jun 2010 14:22:15 -0400 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, On Thu, Jun 24, 2010 at 1:29 PM, James, David (DJ) (SA-1) wrote: > Has anyone tried porting RxTx to RS422? Don't know for sure but . . . > If not, where is all the C code for the other implementations so that I can > give it a shot? http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code There is a file called "PORTING" in the root of rxtx-devel Also refer to the (outdated) information on: http://users.frii.com/jarvi/rxtx/porting.html which has similar information to the PORTING file (trust the PORTING file in case of conflicts) I attached a copy of that file from the 2.2pre2 release to this email. Also, see the "toy box" section: http://rxtx.qbang.org/wiki/index.php/Download for compiled downloads on other platforms good luck. ~Scott -------------- next part -------------- A non-text attachment was scrubbed... Name: PORTING Type: application/octet-stream Size: 5017 bytes Desc: not available URL: From djjames at drs-ssi.com Thu Jun 24 12:22:52 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 13:22:52 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ 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 Jun 24 12:39:42 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:39:42 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 14:10:41 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 15:10:41 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I agree with the RS422/RS485/RS232 control side being the same. Everything I have read says that this should be so. I did notice that there is a RS485 implementation within RxTx that RS485Port.java states is "Non functional". I was thinking that I could/should use the RS485 code as a basis for the RS422 code, if necessary. But this seems a rash course of action if it doesn't function. I am then trying to debug 2 sets of code, instead of working from a good set to get my "bad" set to work correctly. 1) I don't understand the first question "does your RS422 is voltage interface to RS232?" What is "is voltage"? What is an "is voltage interface"? I apologize for my ignorance about this. I have a "true" RS422 port, +/- 5 volt differential if that is what you mean. There is no cross talk between the RS232 and RS422 that I can detect. I know that the RS422 port works, from the command line I have copied a file to that tty device and see voltage changes on my scope on the transmit+ and transmit- pins. 2) No USB dongles are involved in the "badness". That said, as a test, I have run the target java code on a laptop with a USB to serial dongle and a RS232 to RS422 converter hooked to my RS422 source and the serial communications is great. I know that my messaging code is parsing the messages and that the RxTx RS232 code is getting the correct interrupts for the raw data to build the messages up from the raw data. 3) See 2). When I enumerate the ports on my Linux machine, the RS422 port shows up as a serial port. portList = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier foundPortId = null; while (portList.hasMoreElements()) { portId = (gnu.io.CommPortIdentifier) portList.nextElement(); int portType = portId.getPortType(); System.out.println("Found port " + portId.getName()); System.out.println(" of port type " + portId.getPortType()); if (portType == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { portFound = true; foundPortId = portId; } } } I hope this is the information that you requested. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:40 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Thu Jun 24 16:25:11 2010 From: jredman at ergotech.com (Jim Redman) Date: Thu, 24 Jun 2010 16:25:11 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C23DB47.5070308@ergotech.com> RS485 has a 2-wire, half-duplex mode. In this case you need a mechanism to switch sender and receiver. In many cases, the RS485 port will do this for you. Most RS232<->RS485 converters will also manage the switching in a way that is totally transparent to you. In principle, if you don't have a port that handles switching automatically for you, you could control this switching in software. Realistically, unless you have a long delay between sending and reply generation, say 100ms or more, it would be difficult. With most system, the response comes back very quickly and user level code will be too slow to manage that. I think that RS422 is always 4-wire. From the software standpoint, it, and 4-wire RS422 (and current loop and ...) all look the same. There are some electrical issues with RS422 and RS485 particularly termination. I haven't hooked up 485 or 422 in a while so I don't remember all the details, but if you get it wrong it probably won't work. Jim On 06/24/2010 12:39 PM, Mariusz Dec wrote: > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, > I have a 232 port and everything is wonderful. I set the 422 port > up similarly and see no events firing (except output buffer empty). > I set up a scope on the connector and copy a file to the port > (/dev/ttyS1 in my case) and see output. I do the same through RxTx > and see nothing. If this is a setup problem, I am confused as I set > the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so > that I can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From mariusz.dec at gmail.com Fri Jun 25 01:52:48 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 25 Jun 2010 09:52:48 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, now you are sleeping and I have the next day :) So - "voltage interface" means that you have RS232 interface and voltage level converter to use it as RS422. In such case proper work of the RS232 determines proper work of the RS422 (if hw works). In case you make tests on physically different controllers, there may be a lot of traps more, especially now, when we have milions of USB/RS232 dongles vendors and milions of not-properly-working VCP-drivers. Your sentence: "dongle and a RS232 to RS422 converter hooked to" says that you have one RS232 controller and you are using "voltage interface" named >converter< to connect to external RS422 source. It means that only problem is somewhere on the physical part of the interface. If you are seeing signals on the scope, means that you may send dat ok. if you have checked that your USB-serial dongle works good with events, look for the hw mistakes (wiring etc). If you haven't yet checked if your USB-serial dongle works good with events read this: http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html AND always remember that USB-serial dongle isn't serial COM port, this is VIRTUAL Com Port. And this may make a big difference... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t function. > I am then trying to debug 2 sets of code, instead of working from a good set > to get my ?bad? set to work correctly. > > > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on the > transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is parsing > the messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up as > a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:40 PM > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't > the same ? > > Regards > Mariusz > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Fri Jun 25 01:54:39 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 25 Jun 2010 08:54:39 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: <4C23DB47.5070308@ergotech.com> References: <4C23DB47.5070308@ergotech.com> Message-ID: I'm happily using RXTX to communicate with RS422 devices in 4-wire mode using KK-Systems K2 RS232-RS422/RS485 converters (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). Running at 115200 baud -- no issues at all. Regards, Michael Erskine. From jredman at ergotech.com Fri Jun 25 11:29:10 2010 From: jredman at ergotech.com (Jim Redman) Date: Fri, 25 Jun 2010 11:29:10 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <4C23DB47.5070308@ergotech.com> Message-ID: <4C24E766.50102@ergotech.com> Note that the K2 doesn't do automatic switching for RS485, the K2-ADE does. For true RS422 this is irrelevant. We've used a bunch of converters, including some USB versions, some from B&B (http://www.bb-elec.com/) and some (a lot?) of the non-name, low cost RS232-RS485 converters that are out there. There really is no difference as far as the software is concerned. The cabling and termination of 485/422 do tend to be more problematic, and it's likely that the problem lies there rather than anywhere else. Jim On 06/25/2010 01:54 AM, Michael Erskine wrote: > I'm happily using RXTX to communicate with RS422 devices in 4-wire > mode using KK-Systems K2 RS232-RS422/RS485 converters > (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). > Running at 115200 baud -- no issues at all. > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From robohobby at gmail.com Sun Jun 27 07:41:33 2010 From: robohobby at gmail.com (Oleg Lyubchenko) Date: Sun, 27 Jun 2010 17:41:33 +0400 Subject: [Rxtx] Is it possible to receive data from serial port, using RXTX under Linux? Message-ID: Hi, I am trying to use RxTx for a simple project. Small board ETX should communicate with several devices, using serial ports. The application should work under Linux. Java is my favorite language and that was the reason, why RXTX was selected for the task. Under Windows all was OK. But under Linux I see strange thing - It is possible to send data to the port, but it is impossible to read data from port under Linux. Lock files are OK - this part work as it should. User (the user is 'root') has permissions to read-write to port (to device). Kermit and minicom works fine with the modem. The application can send data, but can not read data. As a test example I use standard example class - TwoWaySerialComm.java . I tried both versions of this file - one version without Events and version with Events. I see the same picture with Puppy Linux, with Ubuntu 9.10, OpenSuSE 11. As a hardware I use ETX board and notebook Samsung R40. Both platforms shows the same result - can write to port, can not read from port. What I mean by "send and receive data": I do very simple test - after connection to the device I type "atz" and waiting for the answer from the modem. Normal answer should be "OK". Under Windows, using "TwoWaySerialComm" I see : ATZ ATZ OK Under Linux I see only ATZ ATZ (No normal answer 'OK') Any ideas? PS: If you want to see the code, you can download the code of the project from http://www.robohobby.com/downloads/JavaRxTx.zip There is nothing special there - just project for Netbeans with code of two standard examples. to run it under Windows, use JavaRxTx\r.bat for Linux, use JavaRxTx\sh r.sh Sincerely, Oleg -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at iDIAcomputing.com Sun Jun 27 08:16:25 2010 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 27 Jun 2010 10:16:25 -0400 Subject: [Rxtx] Is it possible to receive data from serial port, using RXTX under Linux? In-Reply-To: References: Message-ID: <4C275D39.3060005@iDIAcomputing.com> Oleg On 6/27/10 9:41 AM, Oleg Lyubchenko wrote: > Under Windows, using "TwoWaySerialComm" I see : > ATZ > ATZ > OK > > Under Linux > I see only > ATZ > ATZ > > (No normal answer 'OK') > > Any ideas? > > PS: If you want to see the code, you can download the code of the > project from > http://www.robohobby.com/downloads/JavaRxTx.zip > There is nothing special there - just project for Netbeans with code of > two standard examples. > > to run it under Windows, use > JavaRxTx\r.bat > for Linux, use JavaRxTx\sh r.sh Oleg, I've not looked at your code, but are you sending both a carriage return and a linefeed to the modem? Windows will generally send both for a \n but Linux will generally only send a linefeed. You may need to use \r\n to get both. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From djjames at drs-ssi.com Mon Jun 28 07:40:32 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Mon, 28 Jun 2010 08:40:32 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: All, I have a box that has RS422 native, the sender of some data. I have another box that has RS422 native. My software runs on this machine. This is where my problem lies. I think I confused the issue with my statement about the 422/232 converter. I have the converter in my test setup to make certain that the sender was sending what I expected, hooked to a laptop with hyperterm. The production setup will have no converters. It cannot have a converter. I have another box on which I have to communicate via RS232. I have that communications up and running. I get the correct information out of my RS232 link. +------+ RS422 +----+ RS232 +-------+ |Sender|-------| Me |-------|Another| +------+ +----+ | Sender| +-------+ On the scope, I have verified that the RS422 sender is setting the transmit lines correctly. I cannot get my side of the RS422 communications to work. I have set my RS422 configuration to be similar to the RS232 that does work. The only event that I am getting is output buffer empty, even though I have turned off that notification (422port.notifyOnOutputEmpty(false);). I have 422port.notifyOnDataAvilable(true), yet I never get that event. It doesn't seem that I have things setup correctly. I have configured the RS422 port per my interface spec with the RS422 sender, yet I don't get any data (no data available events!). If I can't get this to work, I will be writing my own (which isn't a nice thought). From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Friday, June 25, 2010 2:53 AM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, now you are sleeping and I have the next day :) So - "voltage interface" means that you have RS232 interface and voltage level converter to use it as RS422. In such case proper work of the RS232 determines proper work of the RS422 (if hw works). In case you make tests on physically different controllers, there may be a lot of traps more, especially now, when we have milions of USB/RS232 dongles vendors and milions of not-properly-working VCP-drivers. Your sentence: "dongle and a RS232 to RS422 converter hooked to" says that you have one RS232 controller and you are using "voltage interface" named >converter< to connect to external RS422 source. It means that only problem is somewhere on the physical part of the interface. If you are seeing signals on the scope, means that you may send dat ok. if you have checked that your USB-serial dongle works good with events, look for the hw mistakes (wiring etc). If you haven't yet checked if your USB-serial dongle works good with events read this: http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html AND always remember that USB-serial dongle isn't serial COM port, this is VIRTUAL Com Port. And this may make a big difference... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I agree with the RS422/RS485/RS232 control side being the same. Everything I have read says that this should be so. I did notice that there is a RS485 implementation within RxTx that RS485Port.java states is "Non functional". I was thinking that I could/should use the RS485 code as a basis for the RS422 code, if necessary. But this seems a rash course of action if it doesn't function. I am then trying to debug 2 sets of code, instead of working from a good set to get my "bad" set to work correctly. 1) I don't understand the first question "does your RS422 is voltage interface to RS232?" What is "is voltage"? What is an "is voltage interface"? I apologize for my ignorance about this. I have a "true" RS422 port, +/- 5 volt differential if that is what you mean. There is no cross talk between the RS232 and RS422 that I can detect. I know that the RS422 port works, from the command line I have copied a file to that tty device and see voltage changes on my scope on the transmit+ and transmit- pins. 2) No USB dongles are involved in the "badness". That said, as a test, I have run the target java code on a laptop with a USB to serial dongle and a RS232 to RS422 converter hooked to my RS422 source and the serial communications is great. I know that my messaging code is parsing the messages and that the RxTx RS232 code is getting the correct interrupts for the raw data to build the messages up from the raw data. 3) See 2). When I enumerate the ports on my Linux machine, the RS422 port shows up as a serial port. portList = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier foundPortId = null; while (portList.hasMoreElements()) { portId = (gnu.io.CommPortIdentifier) portList.nextElement(); int portType = portId.getPortType(); System.out.println("Found port " + portId.getName()); System.out.println(" of port type " + portId.getPortType()); if (portType == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { portFound = true; foundPortId = portId; } } } I hope this is the information that you requested. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:40 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Jun 28 08:18:08 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 28 Jun 2010 17:18:08 +0300 Subject: [Rxtx] Port to RS422? In-Reply-To: Message-ID: > If I can?t get this to work, I will be writing my own (which isn?t a nice > thought). As stated, from the software point of view RSxxx are identical (or if there is a critical difference lurking somewhere in the details, you are screwed), so I would think that if you roll your own you will run into a similar problem that you are having with rxtx, thus is makes sense to figure out first *what* is the problem here, and then see if you need to write your own. Just my 2 snt, but I've been there, done that. br Kusti From jredman at ergotech.com Mon Jun 28 12:32:38 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 28 Jun 2010 12:32:38 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C28EAC6.8030908@ergotech.com> RS422 is multi-drop. If you just want to monitor what is going on (for debugging or other reasons) connect the two native RS422 systems together (if you can test that these are working at this point so much the better) then add the RS422 converter to the same lines - no need for a pass through. So you'll have: | RS422 |-------------------| RS422 | | | [ RS422 Converter ] The converter will see all traffic and can talk on the line (but that might confuse the other two components. Jim On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From jredman at ergotech.com Mon Jun 28 12:43:57 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 28 Jun 2010 12:43:57 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C28ED6D.2040807@ergotech.com> Just out of interest, what's the make/model of RS422 converter you're using? On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From andy at g0poy.com Mon Jun 28 15:12:00 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 28 Jun 2010 22:12:00 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <20100628221200.6ca3052d@workstation.site> Try TeraTerm rather than Hyperterm just in case that is the problem. http://www.ayera.com/teraterm/ I have known Hyperterm to do all sorts of things you don't tell it. (We gave up asking customers to use it) Sometimes it would receive OK, other times not. We never found out exactly what upset it. Generally we would be using it at 9600 8N1 so nothing special at all. After switching to TeraTerm we have no more problems. Andy On Mon, 28 Jun 2010 08:40:32 -0500 "James, David (DJ) (SA-1)" wrote: > All, > > > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > > > > > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > > > I cannot get my side of the RS422 communications to work. I have set > my RS422 configuration to be similar to the RS232 that does work. The > only event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn't seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don't get > any data (no data available events!). > > > > If I can't get this to work, I will be writing my own (which isn't a > nice thought). > > > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Friday, June 25, 2010 2:53 AM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and > voltage level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is "Non functional". I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn't > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my "bad" set to work correctly. > > > > 1) I don't understand the first question "does your RS422 is > voltage interface to RS232?" What is "is voltage"? What is an "is > voltage interface"? I apologize for my ignorance about this. > > > > I have a "true" RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the "badness". That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is > parsing the messages and that the RxTx RS232 code is getting the correct > interrupts for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:40 PM > > > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. > If this is a setup problem, I am confused as I set the two ports up > similarly. > > > > Thanks, > > DJ > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:18 PM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > From djjames at drs-ssi.com Mon Jun 28 15:28:24 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Mon, 28 Jun 2010 16:28:24 -0500 Subject: [Rxtx] RS422 converter model and (maybe) resolution. In-Reply-To: References: Message-ID: B&B Electronics 422PP9R. Things work great with it. It now appears to be the box. We were able to get another one in for testing and BlockBox is getting events as it should. He suggestion that it might be hardware was spot on. But (of course), you want to make certain that your stuff is working correctly before you accuse the other side of any wrong doing. Thanks for all the advice! DJ -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Monday, June 28, 2010 3:26 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 34, Issue 11 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. Re: Port to RS422? (Kustaa Nyholm) 2. Re: Port to RS422? (Jim Redman) 3. Re: Port to RS422? (Jim Redman) 4. Re: Port to RS422? (Andy Eskelson) ---------------------------------------------------------------------- Message: 1 Date: Mon, 28 Jun 2010 17:18:08 +0300 From: Kustaa Nyholm To: "rxtx at qbang.org" Subject: Re: [Rxtx] Port to RS422? Message-ID: Content-Type: text/plain; charset="iso-8859-1" > If I can?t get this to work, I will be writing my own (which isn?t a nice > thought). As stated, from the software point of view RSxxx are identical (or if there is a critical difference lurking somewhere in the details, you are screwed), so I would think that if you roll your own you will run into a similar problem that you are having with rxtx, thus is makes sense to figure out first *what* is the problem here, and then see if you need to write your own. Just my 2 snt, but I've been there, done that. br Kusti ------------------------------ Message: 2 Date: Mon, 28 Jun 2010 12:32:38 -0600 From: Jim Redman To: RXTX Developers and Users Subject: Re: [Rxtx] Port to RS422? Message-ID: <4C28EAC6.8030908 at ergotech.com> Content-Type: text/plain; charset=windows-1252; format=flowed RS422 is multi-drop. If you just want to monitor what is going on (for debugging or other reasons) connect the two native RS422 systems together (if you can test that these are working at this point so much the better) then add the RS422 converter to the same lines - no need for a pass through. So you'll have: | RS422 |-------------------| RS422 | | | [ RS422 Converter ] The converter will see all traffic and can talk on the line (but that might confuse the other two components. Jim On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com ------------------------------ Message: 3 Date: Mon, 28 Jun 2010 12:43:57 -0600 From: Jim Redman Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Message-ID: <4C28ED6D.2040807 at ergotech.com> Content-Type: text/plain; charset=windows-1252; format=flowed Just out of interest, what's the make/model of RS422 converter you're using? On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com ------------------------------ Message: 4 Date: Mon, 28 Jun 2010 22:12:00 +0100 From: Andy Eskelson To: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Message-ID: <20100628221200.6ca3052d at workstation.site> Content-Type: text/plain; charset=US-ASCII Try TeraTerm rather than Hyperterm just in case that is the problem. http://www.ayera.com/teraterm/ I have known Hyperterm to do all sorts of things you don't tell it. (We gave up asking customers to use it) Sometimes it would receive OK, other times not. We never found out exactly what upset it. Generally we would be using it at 9600 8N1 so nothing special at all. After switching to TeraTerm we have no more problems. Andy On Mon, 28 Jun 2010 08:40:32 -0500 "James, David (DJ) (SA-1)" wrote: > All, > > > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > > > > > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > > > I cannot get my side of the RS422 communications to work. I have set > my RS422 configuration to be similar to the RS232 that does work. The > only event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn't seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don't get > any data (no data available events!). > > > > If I can't get this to work, I will be writing my own (which isn't a > nice thought). > > > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Friday, June 25, 2010 2:53 AM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and > voltage level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is "Non functional". I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn't > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my "bad" set to work correctly. > > > > 1) I don't understand the first question "does your RS422 is > voltage interface to RS232?" What is "is voltage"? What is an "is > voltage interface"? I apologize for my ignorance about this. > > > > I have a "true" RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the "badness". That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is > parsing the messages and that the RxTx RS232 code is getting the correct > interrupts for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:40 PM > > > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. > If this is a setup problem, I am confused as I set the two ports up > similarly. > > > > Thanks, > > DJ > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:18 PM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > 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 End of Rxtx Digest, Vol 34, Issue 11 ************************************ From msemtd at googlemail.com Tue Jun 29 04:05:10 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 29 Jun 2010 11:05:10 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: <20100628221200.6ca3052d@workstation.site> References: <20100628221200.6ca3052d@workstation.site> Message-ID: On 28 June 2010 22:12, Andy Eskelson wrote: > Try TeraTerm rather than Hyperterm just in case that is the problem. > http://www.ayera.com/teraterm/ I recommend RealTerm over teraterm pro (proper FOSS licence, you get the source code, actively maintained, etc.): http://realterm.sourceforge.net/ Regards, Michael Erskine. From mariusz.dec at gmail.com Tue Jun 29 04:37:25 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 29 Jun 2010 12:37:25 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <20100628221200.6ca3052d@workstation.site> Message-ID: Hi, a bit from my experience :). I am using my own terminals only. Why? Because good transmission practice says that in data packet should be a header, trailer, checksum, block length etc. My terminals (software like Hyperterm) for each project have a simple current protocols parsers and shows important data in clear form. Additionally I can see whole time of the developing that second side of the transmission path works good as well (for example - good checksum arrives). Currently I am receiving /sendign quite large packets - about 50 bytes - how to look inside without tools? This is easy to write ad-hoc specialized terminal and this helps a lot :). Regards Mariusz 2010/6/29 Michael Erskine > On 28 June 2010 22:12, Andy Eskelson wrote: > > Try TeraTerm rather than Hyperterm just in case that is the problem. > > http://www.ayera.com/teraterm/ > > I recommend RealTerm over teraterm pro (proper FOSS licence, you get > the source code, actively maintained, etc.): > http://realterm.sourceforge.net/ > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From leo.guimaraes at gmail.com Fri Jun 18 13:29:14 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Fri, 18 Jun 2010 15:29:14 -0400 Subject: [Rxtx] Virtual Port with RXTX Message-ID: Hello everybody, Please, im crazy trying to solve this problem: I created a virtual port in my server to receive data over the ethernet from a serial port in the client machine. Im using socat for that: In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: 192.168.102.41:54321 its working fine for me, accessing the virtual port via CuteCom or any terminal. But i can't access this port via RXTX. The getPortIdentifiers() method returns only the /dev/ttyS0 port. Please guys, could you help me about that? Thank you very much! Leandro Guimar?es -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Fri Jun 18 23:43:50 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 19 Jun 2010 07:43:50 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: Hi, In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: > 192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or any > terminal. But i can't access this port via RXTX. The getPortIdentifiers() > method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock Try to change name of the virtual port. I suppose you are using Linux, so: In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid prefixes for the Linux com ports. Add your prefix there or change your VCP name to match to any predefined prefix there. Regards Mariusz > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Sat Jun 19 08:03:06 2010 From: jredman at ergotech.com (Jim Redman) Date: Sat, 19 Jun 2010 08:03:06 -0600 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: <4C1CCE1A.90201@ergotech.com> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports so: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 or whatever you need for the virtual port. The ports will enumerate in the order give (I don't know whether this is a guaranteed behavior or just the way it happens to be). Jim On 06/18/2010 11:43 PM, Mariusz Dec wrote: > Hi, > > In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > tcp:192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or > any terminal. But i can't access this port via RXTX. The > getPortIdentifiers() method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork > file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > > Try to change name of the virtual port. > > I suppose you are using Linux, so: > > In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > prefixes for the Linux com ports. > Add your prefix there or change your VCP name to match to any predefined > prefix there. > > Regards > Mariusz > > > > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From leo.guimaraes at gmail.com Mon Jun 21 13:23:26 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 16:23:26 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: <4C1CCE1A.90201@ergotech.com> References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hello, Change my virtual port to ttySXX worked fine... But now, im having another problem... I dont know why, but the virtual port is never calling the SerialEvent in the SerialPortEventListenner... using the real Serial port, works fine. But it doesnt work with the virtual port... Somebody have an idea?? Pleasse! Thank you!! Leandro Guimar?es On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: > You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > so: > > > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > > or whatever you need for the virtual port. The ports will enumerate in the > order give (I don't know whether this is a guaranteed behavior or just the > way it happens to be). > > Jim > > > > > On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> Hi, >> >> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave >> tcp:192.168.102.41:54321 >> >> >> its working fine for me, accessing the virtual port via CuteCom or >> any terminal. But i can't access this port via RXTX. The >> getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >> Please guys, could you help me about that? >> >> >> In client machine: socat tcp-l:54321,reuseaddr,fork >> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >> Try to change name of the virtual port. >> >> I suppose you are using Linux, so: >> >> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> prefixes for the Linux com ports. >> Add your prefix there or change your VCP name to match to any predefined >> prefix there. >> >> Regards >> Mariusz >> >> >> >> Thank you very much! >> Leandro Guimar?es >> >> >> _______________________________________________ >> 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 >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > > _______________________________________________ > 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 Mon Jun 21 13:47:13 2010 From: george.dma at gmail.com (George H) Date: Mon, 21 Jun 2010 19:47:13 +0000 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, This might be because it is a virtual port. I used to do testing on usb/serial port and there were some "signals" it would not send me that a real serial port would. Try to see what signals your serial port sends you that the virtual port doesn't. I think there are some serial port sniffers out there where you can intercept the signals. Also would do good if you look at some technical tutorials on how serial port signals work. A good site which I read over many times to try to understand why things are the way they are is http://www.arcelect.com/rs232.htm I hope this gave you some ideas. Good luck -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Hello, > > ?? Change my virtual port to ttySXX worked fine... > > ?? But now, im having another problem... > > ? I dont know why, but the virtual port is never calling the SerialEvent in > the SerialPortEventListenner... using the real Serial port, works fine. But > it doesnt work with the virtual port... > > > ?? Somebody have an idea?? Pleasse! > > Thank you!! > Leandro Guimar?es > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports >> so: >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> the order give (I don't know whether this is a guaranteed behavior or just >> the way it happens to be). >> >> Jim >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >>> >>> Hi, >>> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >>> ? ?tcp:192.168.102.41:54321 >>> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >>> ? ?any terminal. But i can't access this port via RXTX. The >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >>> >>> ? ? ? Please guys, could you help me about that? >>> >>> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >>> >>> Try to change name of the virtual port. >>> >>> I suppose you are using Linux, so: >>> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >>> prefixes for the Linux com ports. >>> Add your prefix there or change your VCP name to match to any predefined >>> prefix there. >>> >>> Regards >>> Mariusz >>> >>> >>> >>> ? ?Thank you very much! >>> ? ?Leandro Guimar?es >>> >>> >>> ? ?_______________________________________________ >>> ? ?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 >> >> -- >> Jim Redman >> (505) 662 5156 x85 >> http://www.ergotech.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From leo.guimaraes at gmail.com Mon Jun 21 14:56:15 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 17:56:15 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Thanks George, Please, do you know what represents a "data available" in RXTX? Wich signal calls the Listener's Notify? Its the last thing that i need to do to finish my project here! Thank you very much! Leandro Guimar?es 2010/6/21 George H > Hi, > > This might be because it is a virtual port. > I used to do testing on usb/serial port and there were some "signals" > it would not send me that a real serial port would. > Try to see what signals your serial port sends you that the virtual > port doesn't. I think there are some serial port sniffers out there > where you can intercept the signals. Also would do good if you look at > some technical tutorials on how serial port signals work. > > A good site which I read over many times to try to understand why > things are the way they are is http://www.arcelect.com/rs232.htm > > I hope this gave you some ideas. > Good luck > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Hello, > > > > Change my virtual port to ttySXX worked fine... > > > > But now, im having another problem... > > > > I dont know why, but the virtual port is never calling the SerialEvent > in > > the SerialPortEventListenner... using the real Serial port, works fine. > But > > it doesnt work with the virtual port... > > > > > > Somebody have an idea?? Pleasse! > > > > Thank you!! > > Leandro Guimar?es > > > > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > wrote: > >> > >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > >> so: > >> > >> > >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> > >> or whatever you need for the virtual port. The ports will enumerate in > >> the order give (I don't know whether this is a guaranteed behavior or > just > >> the way it happens to be). > >> > >> Jim > >> > >> > >> > >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >>> > >>> Hi, > >>> > >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >>> tcp:192.168.102.41:54321 > >>> > >>> its working fine for me, accessing the virtual port via CuteCom or > >>> any terminal. But i can't access this port via RXTX. The > >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >>> > >>> Please guys, could you help me about that? > >>> > >>> > >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >>> > >>> Try to change name of the virtual port. > >>> > >>> I suppose you are using Linux, so: > >>> > >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >>> prefixes for the Linux com ports. > >>> Add your prefix there or change your VCP name to match to any > predefined > >>> prefix there. > >>> > >>> Regards > >>> Mariusz > >>> > >>> > >>> > >>> Thank you very much! > >>> Leandro Guimar?es > >>> > >>> > >>> _______________________________________________ > >>> 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 > >> > >> -- > >> Jim Redman > >> (505) 662 5156 x85 > >> http://www.ergotech.com > >> _______________________________________________ > >> 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 george.dma at gmail.com Mon Jun 21 22:51:50 2010 From: george.dma at gmail.com (George H) Date: Tue, 22 Jun 2010 07:51:50 +0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Did you read the site I posted? If you did you would have figured out which pin signal on the RS232 interface most likely triggers the data available event. It might be pin 2 and it might be pin 3, depends what kind of serial port you have and the cable. Plus i'm no expert on on RS-232 interfaces, I just know that if I have my hardware in front of me, and the source code of rxtx and a rs-232 specifications sheet then I can debug the problem and find out. This is what I believe you should do to get started to find out the "what, where and why" of your problem. -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Thanks George, > > ?? Please, do you know what represents a "data available" in RXTX? Wich > signal calls the Listener's Notify? > > ?? Its the last thing that i need to do to finish my project here! > > Thank you very much! > > Leandro Guimar?es > > > 2010/6/21 George H >> >> Hi, >> >> This might be because it is a virtual port. >> I used to do testing on usb/serial port and there were some "signals" >> it would not send me that a real serial port would. >> Try to see what signals your serial port sends you that the virtual >> port doesn't. I think there are some serial port sniffers out there >> where you can intercept the signals. Also would do good if you look at >> some technical tutorials on how serial port signals work. >> >> A good site which I read over many times to try to understand why >> things are the way they are is http://www.arcelect.com/rs232.htm >> >> I hope this gave you some ideas. >> Good luck >> -- >> George H >> george.dma at gmail.com >> >> >> >> 2010/6/21 Leandro Guimar?es : >> > Hello, >> > >> > ?? Change my virtual port to ttySXX worked fine... >> > >> > ?? But now, im having another problem... >> > >> > ? I dont know why, but the virtual port is never calling the SerialEvent >> > in >> > the SerialPortEventListenner... using the real Serial port, works fine. >> > But >> > it doesnt work with the virtual port... >> > >> > >> > ?? Somebody have an idea?? Pleasse! >> > >> > Thank you!! >> > Leandro Guimar?es >> > >> > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman >> > wrote: >> >> >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of >> >> ports >> >> so: >> >> >> >> >> >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> >> the order give (I don't know whether this is a guaranteed behavior or >> >> just >> >> the way it happens to be). >> >> >> >> Jim >> >> >> >> >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >> >>> >> >>> Hi, >> >>> >> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >> >>> ? ?tcp:192.168.102.41:54321 >> >>> >> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >> >>> ? ?any terminal. But i can't access this port via RXTX. The >> >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >>> >> >>> ? ? ? Please guys, could you help me about that? >> >>> >> >>> >> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >>> >> >>> Try to change name of the virtual port. >> >>> >> >>> I suppose you are using Linux, so: >> >>> >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> >>> prefixes for the Linux com ports. >> >>> Add your prefix there or change your VCP name to match to any >> >>> predefined >> >>> prefix there. >> >>> >> >>> Regards >> >>> Mariusz >> >>> >> >>> >> >>> >> >>> ? ?Thank you very much! >> >>> ? ?Leandro Guimar?es >> >>> >> >>> >> >>> ? ?_______________________________________________ >> >>> ? ?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 >> >> >> >> -- >> >> Jim Redman >> >> (505) 662 5156 x85 >> >> http://www.ergotech.com >> >> _______________________________________________ >> >> Rxtx mailing list >> >> Rxtx at qbang.org >> >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > >> > _______________________________________________ >> > Rxtx mailing list >> > Rxtx at qbang.org >> > http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > > > From mariusz.dec at gmail.com Tue Jun 22 05:32:01 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 22 Jun 2010 13:32:01 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, I am working with virtual ports only. Because of some problems with events I have changed whole idea. I did a thread in Java which is looking for port data in pool. If data comes in, I parse it and than generate an Java exception for the application. This works very good from several months and has an advantage more - is faster than events services. I have published many times an example code. Look for 2009'november thread "RXTX close() problem solved". In this example you can set Exception generation in read thread. There is a lot of "try-catch" loops which prevents system while you disconnect USB as well. For me works very good in Mac/Linux and Windows. Regards Mariusz 2010/6/22 George H > Did you read the site I posted? If you did you would have figured out > which pin signal on the RS232 interface most likely triggers the data > available event. > It might be pin 2 and it might be pin 3, depends what kind of serial > port you have and the cable. > > Plus i'm no expert on on RS-232 interfaces, I just know that if I have > my hardware in front of me, and the source code of rxtx and a rs-232 > specifications sheet then I can debug the problem and find out. This > is what I believe you should do to get started to find out the "what, > where and why" of your problem. > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Thanks George, > > > > Please, do you know what represents a "data available" in RXTX? Wich > > signal calls the Listener's Notify? > > > > Its the last thing that i need to do to finish my project here! > > > > Thank you very much! > > > > Leandro Guimar?es > > > > > > 2010/6/21 George H > >> > >> Hi, > >> > >> This might be because it is a virtual port. > >> I used to do testing on usb/serial port and there were some "signals" > >> it would not send me that a real serial port would. > >> Try to see what signals your serial port sends you that the virtual > >> port doesn't. I think there are some serial port sniffers out there > >> where you can intercept the signals. Also would do good if you look at > >> some technical tutorials on how serial port signals work. > >> > >> A good site which I read over many times to try to understand why > >> things are the way they are is http://www.arcelect.com/rs232.htm > >> > >> I hope this gave you some ideas. > >> Good luck > >> -- > >> George H > >> george.dma at gmail.com > >> > >> > >> > >> 2010/6/21 Leandro Guimar?es : > >> > Hello, > >> > > >> > Change my virtual port to ttySXX worked fine... > >> > > >> > But now, im having another problem... > >> > > >> > I dont know why, but the virtual port is never calling the > SerialEvent > >> > in > >> > the SerialPortEventListenner... using the real Serial port, works > fine. > >> > But > >> > it doesnt work with the virtual port... > >> > > >> > > >> > Somebody have an idea?? Pleasse! > >> > > >> > Thank you!! > >> > Leandro Guimar?es > >> > > >> > > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > >> > wrote: > >> >> > >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of > >> >> ports > >> >> so: > >> >> > >> >> > >> >> > >> >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> >> > >> >> or whatever you need for the virtual port. The ports will enumerate > in > >> >> the order give (I don't know whether this is a guaranteed behavior or > >> >> just > >> >> the way it happens to be). > >> >> > >> >> Jim > >> >> > >> >> > >> >> > >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> >>> > >> >>> Hi, > >> >>> > >> >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >> >>> tcp:192.168.102.41:54321 > >> >>> > >> >>> its working fine for me, accessing the virtual port via CuteCom > or > >> >>> any terminal. But i can't access this port via RXTX. The > >> >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >> >>> > >> >>> Please guys, could you help me about that? > >> >>> > >> >>> > >> >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >> >>> > >> >>> Try to change name of the virtual port. > >> >>> > >> >>> I suppose you are using Linux, so: > >> >>> > >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >> >>> prefixes for the Linux com ports. > >> >>> Add your prefix there or change your VCP name to match to any > >> >>> predefined > >> >>> prefix there. > >> >>> > >> >>> Regards > >> >>> Mariusz > >> >>> > >> >>> > >> >>> > >> >>> Thank you very much! > >> >>> Leandro Guimar?es > >> >>> > >> >>> > >> >>> _______________________________________________ > >> >>> 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 > >> >> > >> >> -- > >> >> Jim Redman > >> >> (505) 662 5156 x85 > >> >> http://www.ergotech.com > >> >> _______________________________________________ > >> >> 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 > >> > > >> > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Tue Jun 22 07:20:17 2010 From: showard314 at gmail.com (Scott Howard) Date: Tue, 22 Jun 2010 09:20:17 -0400 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails Message-ID: This is forwarded from: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472053 by Jan Niehusmann I tried putting this on the bug tracker but I couldn't get access In the static initializer of gnu.io.RXTXPort, an exception when initializing the static variable 'z' is silently discarded: try { z = new Zystem(); } catch ( Exception e ) {}; This leads to NullPointerExceptions later, which are difficult to debug as the original exception is lost. I did change the code to try { z = new Zystem(); } catch ( Exception e ) { throw new Error(e.toString()); }; for debugging. Probably a more specific exception would be more appropriate, but the point is that leaving z undefined without reporting an error makes debugging unnecessarily difficult. Thanks. From g3vbv at blueyonder.co.uk Tue Jun 22 19:20:11 2010 From: g3vbv at blueyonder.co.uk (Sid Boyce) Date: Wed, 23 Jun 2010 02:20:11 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar Message-ID: <4C21614B.3060504@blueyonder.co.uk> I am using openSUSE 11.3 RC1. "rfcomm -a" lists no devices From dmesg =========== [288811.093151] usb 2-4.4.2: new full speed USB device using ehci_hcd and address 16 [288811.207421] usb 2-4.4.2: New USB device found, idVendor=0403, idProduct=6001 [288811.207431] usb 2-4.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [288811.207438] usb 2-4.4.2: Product: FT232R USB UART [288811.207443] usb 2-4.4.2: Manufacturer: FTDI [288811.207447] usb 2-4.4.2: SerialNumber: A100efz7 [288811.210509] ftdi_sio 2-4.4.2:1.0: FTDI USB Serial Device converter detected [288811.210534] usb 2-4.4.2: Detected FT232RL [288811.210536] usb 2-4.4.2: Number of endpoints 2 [288811.210538] usb 2-4.4.2: Endpoint 1 MaxPacketSize 64 [288811.210540] usb 2-4.4.2: Endpoint 2 MaxPacketSize 64 [288811.210541] usb 2-4.4.2: Setting MaxPacketSize 64 [288811.210822] usb 2-4.4.2: FTDI USB Serial Device converter now attached to ttyUSB1 Package built and installed OK in /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/amd64, it also installed /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/RXTXcomm.jar slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar RXTXcomm.jar Failed to load Main-Class manifest attribute from RXTXcomm.jar # rpm -qa |grep java java-1_6_0-sun-1.6.0.u20-1.15.x86_64 gcc44-java-4.4.2_20100116-1.2.x86_64 netbeans-javaparser-6.8-1.1.noarch gcc45-java-4.5.0_20100604-1.1.x86_64 ant-javadoc-1.7.1-11.1.noarch javahelp2-2.0.05-6.28.noarch gcc43-java-4.3.4_20091019-2.25.x86_64 gcc-java-4.5-5.2.x86_64 java-ca-certificates-1-5.1.noarch java-1_6_0-sun-devel-1.6.0.u20-1.15.x86_64 lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> echo $JAVA_HOME /usr/lib64/jvm/java-1.6.0-sun-1.6.0 > l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/amd64/ total 6440 drwxr-xr-x 8 root root 4096 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ drwxr-xr-x 2 root root 23 2010-06-18 16:41 headless/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 jli/ -rw-r--r-- 1 root root 652 2010-04-12 22:00 jvm.cfg -rwxr-xr-x 1 root root 15836 2010-04-12 22:25 libattach.so* -rwxr-xr-x 1 root root 757091 2010-04-12 22:25 libawt.so* -rwxr-xr-x 1 root root 413267 2010-04-12 22:25 libcmm.so* -rwxr-xr-x 1 root root 217736 2010-04-12 22:25 libdcpr.so* -rwxr-xr-x 1 root root 120029 2010-04-12 22:30 libdeploy.so* -rwxr-xr-x 1 root root 21670 2010-04-12 22:25 libdt_socket.so* -rwxr-xr-x 1 root root 692649 2010-04-12 22:25 libfontmanager.so* -rwxr-xr-x 1 root root 237073 2010-04-12 22:25 libhprof.so* -rwxr-xr-x 1 root root 50085 2010-04-12 22:25 libinstrument.so* -rwxr-xr-x 1 root root 27244 2010-04-12 22:25 libioser12.so* -rwxr-xr-x 1 root root 46723 2010-04-12 22:25 libj2gss.so* -rwxr-xr-x 1 root root 14272 2010-04-12 22:25 libj2pcsc.so* -rwxr-xr-x 1 root root 78017 2010-04-12 22:25 libj2pkcs11.so* -rwxr-xr-x 1 root root 7980 2010-04-12 22:25 libjaas_unix.so* -rwxr-xr-x 1 root root 28919 2010-04-12 22:25 libjava_crw_demo.so* -rwxr-xr-x 1 root root 231135 2010-04-12 22:25 libjava.so* -rwxr-xr-x 1 root root 7099 2010-04-12 22:25 libjawt.so* -rwxr-xr-x 1 root root 293725 2010-04-12 22:25 libjdwp.so* -rwxr-xr-x 1 root root 224947 2010-04-12 22:25 libjpeg.so* -rwxr-xr-x 1 root root 10964 2010-04-12 22:25 libjsig.so* -rwxr-xr-x 1 root root 260521 2010-04-12 22:25 libjsound.so* -rwxr-xr-x 1 root root 37449 2010-04-12 22:25 libmanagement.so* -rwxr-xr-x 1 root root 734280 2010-04-12 22:25 libmlib_image.so* -rwxr-xr-x 1 root root 6667 2010-04-12 22:25 libnative_chmod_g.so* -rwxr-xr-x 1 root root 6571 2010-04-12 22:25 libnative_chmod.so* -rwxr-xr-x 1 root root 111945 2010-04-12 22:25 libnet.so* -rwxr-xr-x 1 root root 43716 2010-04-12 22:25 libnio.so* -rwxr-xr-x 1 root root 15651 2010-04-12 22:25 libnpt.so* -rwxr-xr-x 1 root root 6420 2010-04-12 22:25 librmi.so* -rwxr-xr-x 1 root root 77907 2010-06-18 16:56 librxtxI2C-2.2pre1.so* -rw-r--r-- 1 root root 97530 2010-06-18 16:56 librxtxI2C.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxI2C.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxI2C.so -> librxtxI2C-2.2pre1.so* -rwxr-xr-x 1 root root 55253 2010-06-18 16:56 librxtxParallel-2.2pre1.so* -rw-r--r-- 1 root root 66164 2010-06-18 16:56 librxtxParallel.a -rwxr-xr-x 1 root root 1035 2010-06-18 16:56 librxtxParallel.la* lrwxrwxrwx 1 root root 26 2010-06-18 16:56 librxtxParallel.so -> librxtxParallel-2.2pre1.so* -rwxr-xr-x 1 root root 79049 2010-06-18 16:56 librxtxRaw-2.2pre1.so* -rw-r--r-- 1 root root 100218 2010-06-18 16:56 librxtxRaw.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxRaw.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxRaw.so -> librxtxRaw-2.2pre1.so* -rwxr-xr-x 1 root root 78134 2010-06-18 16:56 librxtxRS485-2.2pre1.so* -rw-r--r-- 1 root root 98662 2010-06-18 16:56 librxtxRS485.a -rwxr-xr-x 1 root root 1014 2010-06-18 16:56 librxtxRS485.la* lrwxrwxrwx 1 root root 23 2010-06-18 16:56 librxtxRS485.so -> librxtxRS485-2.2pre1.so* -rwxr-xr-x 1 root root 192681 2010-06-18 16:56 librxtxSerial-2.2pre1.so* -rw-r--r-- 1 root root 267524 2010-06-18 16:56 librxtxSerial.a -rwxr-xr-x 1 root root 1021 2010-06-18 16:56 librxtxSerial.la* lrwxrwxrwx 1 root root 24 2010-06-18 16:56 librxtxSerial.so -> librxtxSerial-2.2pre1.so* -rwxr-xr-x 1 root root 48036 2010-04-12 22:25 libsaproc.so* -rwxr-xr-x 1 root root 294575 2010-04-12 22:25 libsplashscreen.so* -rwxr-xr-x 1 root root 134786 2010-04-12 22:25 libunpack.so* -rwxr-xr-x 1 root root 66292 2010-04-12 22:25 libverify.so* -rwxr-xr-x 1 root root 91191 2010-04-12 22:25 libzip.so* drwxr-xr-x 2 root root 23 2010-06-18 16:41 motif21/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 native_threads/ drwxr-xr-x 2 root root 56 2010-06-18 16:41 server/ -rw------- 1 root root 0 2010-06-18 16:53 stC2p3qT -rw------- 1 root root 0 2010-06-18 16:53 stJpl8lW -rw------- 1 root root 0 2010-06-18 16:53 stnb1qWY -rw------- 1 root root 0 2010-06-18 16:53 stYjTgRS -rw------- 1 root root 0 2010-06-18 16:53 stZA8aVV drwxr-xr-x 2 root root 23 2010-06-18 16:41 xawt/ lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/ total 1300 drwxr-xr-x 2 root root 125 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ -rw-r--r-- 1 root root 8239 2010-04-12 22:08 dnsns.jar -rw-r--r-- 1 root root 842216 2010-06-10 12:45 localedata.jar -rw-r--r-- 1 root root 429 2010-04-12 22:23 meta-index -rwxr-xr-x 1 root root 61389 2010-06-18 16:56 RXTXcomm.jar* -rw-r--r-- 1 root root 170239 2010-04-12 21:58 sunjce_provider.jar -rw-r--r-- 1 root root 230608 2010-04-12 22:08 sunpkcs11.jar Help appreciated. 73 ... Sid. -- Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support Specialist, Cricket Coach Microsoft Windows Free Zone - Linux used for all Computing Tasks From Kustaa.Nyholm at planmeca.com Tue Jun 22 23:38:46 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 08:38:46 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: Message-ID: > I did change the code to > try { > z = new Zystem(); > } catch ( Exception e ) { > throw new Error(e.toString()); > }; Is there a reason why this could/should not be: > try { > z = new Zystem(); > } catch ( Throwable e ) { > e.printStackTrace(System.err); > }; From msemtd at googlemail.com Wed Jun 23 02:14:25 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:14:25 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar In-Reply-To: <4C21614B.3060504@blueyonder.co.uk> References: <4C21614B.3060504@blueyonder.co.uk> Message-ID: On 23 June 2010 02:20, Sid Boyce wrote: > slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar > RXTXcomm.jar > Failed to load Main-Class manifest attribute from > RXTXcomm.jar > Help appreciated. > 73 ... Sid. Well Sid, it's pretty obvious to me: you're trying to launch a jar that doesn't contain a main(). What exactly are you trying to achieve by running "java -jar RXTXcomm.jar"? Regards, Michael Erskine. From msemtd at googlemail.com Wed Jun 23 02:17:11 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:17:11 +0100 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: On 23 June 2010 06:38, Kustaa Nyholm wrote: > >> I did change the code to >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >> ? ? ? ? ? ? ? ?}; > > Is there a reason why this could/should not be: > > >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >> ? ? ? ? ? ? ? ?}; Or even just let the exception bubble up and kill whatever thread caused the class to load :) I vote for the removal of Zystem BTW! Regards, Michael Erskine. From george.dma at gmail.com Wed Jun 23 02:34:07 2010 From: george.dma at gmail.com (George H) Date: Wed, 23 Jun 2010 11:34:07 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: -- George H george.dma at gmail.com On Wed, Jun 23, 2010 at 11:17 AM, Michael Erskine wrote: > On 23 June 2010 06:38, Kustaa Nyholm wrote: >> >>> I did change the code to >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >>> ? ? ? ? ? ? ? ?}; >> >> Is there a reason why this could/should not be: >> >> >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >>> ? ? ? ? ? ? ? ?}; > > Or even just let the exception bubble up and kill whatever thread > caused the class to load :) > > I vote for the removal of Zystem BTW! > > Regards, > Michael Erskine. I would prefer that an exception is thrown rather than the stack trace be printed. If anyone is using loggers then it would be useful to catch the exception and log it, rather than let it come out in the error stream where no one might look. From Steffen.DETTMER at ingenico.com Wed Jun 23 03:28:45 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 11:28:45 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: <20100623092844.GF20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 08:38 +0300: > > I did change the code to > > try { > > z = new Zystem(); > > } catch ( Exception e ) { > > throw new Error(e.toString()); > > }; > > Is there a reason why this could/should not be: > > > try { > > z = new Zystem(); > > } catch ( Throwable e ) { > > e.printStackTrace(System.err); > > }; Is this intentionally not throwing the exception? Well, then it still would be discarded (althrough not neccesarily silently :)). BTW, I don't think System.err is a good idea. It is `statically initialized'? I think then this means it is unclear who the caller is and who could catch this exception. Wouldn't it be better to store the exception in a member and throw it when needing Zystem (e.g. in new or open)? 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 Kustaa.Nyholm at planmeca.com Wed Jun 23 03:55:30 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 12:55:30 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: >> Is there a reason why this could/should not be: >> >>> try { >>> z = new Zystem(); >>> } catch ( Throwable e ) { >>> e.printStackTrace(System.err); >>> }; > > Is this intentionally not throwing the exception? Well, no, just a hasty reply from my part. > still would be discarded (althrough not neccesarily silently :)). > BTW, I don't think System.err is a good idea. > > It is `statically initialized'? I think then this means it is > unclear who the caller is and who could catch this exception. > Even so re-throwing the exception would make sense so that the application developer has a chance to handle this in whichever way they want. Of course logically this should not then print the stacktrace because that is the responsibility of the application developer. But so many do not handle these cases sensibly so from the application user point of view it is nice to have something on the console to aid in trouble shooting. Have not checked the context in which this happens so that might influence my opinion. > Wouldn't it be better to store the exception in a member and > throw it when needing Zystem (e.g. in new or open) I'm of the fail-fast school of thought so I think it should be reported and re-thrown as it happens, not later. br Kusti From pietro.galassi at gmail.com Wed Jun 23 05:59:29 2010 From: pietro.galassi at gmail.com (Pietro Galassi) Date: Wed, 23 Jun 2010 13:59:29 +0200 Subject: [Rxtx] Resource temporarily unavaible on writeByte() Message-ID: Hi, i have successfully installe RXTX 64bit version from UBUNTO repository. I wrote a simple test program and it shows i have 3 ports avaible on my system: /dev/ttyS1 - Serial /dev/ttyS0 - Serial /dev/lp0 - Parallel but as soon as i try to "writeByte" any data on the parallel port it always gives me: java.io.IOException: Resource temporarily unavaible on writeByte() My simple code is: ... outputStream = parallelPort.getOutputStream() ; System.out.println("Write..."); outputStream.write(88); outputStream.flush(); outputStream.close(); ... int mode = parallelPort.getMode(); gives always 0. Anyone can help pls ? Thanks a lot, Pietro Galassi -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Jun 23 10:35:37 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 18:35:37 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: <20100623163536.GI20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 12:55 +0300: > > Wouldn't it be better to store the exception in a member and > > throw it when needing Zystem (e.g. in new or open) > > I'm of the fail-fast school of thought so I think it should be > reported and re-thrown as it happens, not later. Ahh yes, I agree, in general it is much better to fail quick, loud and verbosely, right! However, if this is a static { } block, AFAIK it is not defined when it will be executed (Before application start? Or later, when loading the class later? Or when using it first time?). If the exception would be thrown before main() is called, I think it is difficult to catch it. I think some general global hook must be used to do so. Simpler to handle, if it is thrown when invocating some function, then it can be caught by try { } catch. (or am I wrong or outdated?) 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 rbreznak at neuronrobotics.com Wed Jun 23 11:46:21 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Wed, 23 Jun 2010 13:46:21 -0400 Subject: [Rxtx] Bundling native libraries Message-ID: Hello, I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. Has anyone had experience in doing this? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Wed Jun 23 18:26:17 2010 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 23 Jun 2010 17:26:17 -0700 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Whoops, forgot to copy this to the RXTX list ... ---------- Forwarded message ---------- From: Brian Schlining Date: Wed, Jun 23, 2010 at 11:11 Subject: Re: [Rxtx] Bundling native libraries To: "Breznak, Robert" Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a > one jar. Its to the point where I have an Ant script that pulls all of the > jars together, but I haven't been able to get the native libraries to work; > They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the > user to get and use. They don't need to worry about external dependencies > and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 24 00:37:35 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 24 Jun 2010 08:37:35 +0200 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Here is a snippet from my ant file. I actually unjar the rxtx jar file and add my own classes to it for Mac and WIndows. The snippet below is actually for Mac but just for your info I am using nsis and launch4j to create an exectuable for windows. I also copy the rxtx libs to the root folder of my application: On 24.06.2010, at 02:26, Brian Schlining wrote: > Whoops, forgot to copy this to the RXTX list ... > > ---------- Forwarded message ---------- > From: Brian Schlining > Date: Wed, Jun 23, 2010 at 11:11 > Subject: Re: [Rxtx] Bundling native libraries > To: "Breznak, Robert" > > > Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc > > On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 11:29:21 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 12:29:21 -0500 Subject: [Rxtx] Port to RS422? Message-ID: Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jun 24 12:18:10 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:18:10 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Thu Jun 24 12:22:15 2010 From: showard314 at gmail.com (Scott Howard) Date: Thu, 24 Jun 2010 14:22:15 -0400 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, On Thu, Jun 24, 2010 at 1:29 PM, James, David (DJ) (SA-1) wrote: > Has anyone tried porting RxTx to RS422? Don't know for sure but . . . > If not, where is all the C code for the other implementations so that I can > give it a shot? http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code There is a file called "PORTING" in the root of rxtx-devel Also refer to the (outdated) information on: http://users.frii.com/jarvi/rxtx/porting.html which has similar information to the PORTING file (trust the PORTING file in case of conflicts) I attached a copy of that file from the 2.2pre2 release to this email. Also, see the "toy box" section: http://rxtx.qbang.org/wiki/index.php/Download for compiled downloads on other platforms good luck. ~Scott -------------- next part -------------- A non-text attachment was scrubbed... Name: PORTING Type: application/octet-stream Size: 5017 bytes Desc: not available URL: From djjames at drs-ssi.com Thu Jun 24 12:22:52 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 13:22:52 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ 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 Jun 24 12:39:42 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:39:42 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 14:10:41 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 15:10:41 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I agree with the RS422/RS485/RS232 control side being the same. Everything I have read says that this should be so. I did notice that there is a RS485 implementation within RxTx that RS485Port.java states is "Non functional". I was thinking that I could/should use the RS485 code as a basis for the RS422 code, if necessary. But this seems a rash course of action if it doesn't function. I am then trying to debug 2 sets of code, instead of working from a good set to get my "bad" set to work correctly. 1) I don't understand the first question "does your RS422 is voltage interface to RS232?" What is "is voltage"? What is an "is voltage interface"? I apologize for my ignorance about this. I have a "true" RS422 port, +/- 5 volt differential if that is what you mean. There is no cross talk between the RS232 and RS422 that I can detect. I know that the RS422 port works, from the command line I have copied a file to that tty device and see voltage changes on my scope on the transmit+ and transmit- pins. 2) No USB dongles are involved in the "badness". That said, as a test, I have run the target java code on a laptop with a USB to serial dongle and a RS232 to RS422 converter hooked to my RS422 source and the serial communications is great. I know that my messaging code is parsing the messages and that the RxTx RS232 code is getting the correct interrupts for the raw data to build the messages up from the raw data. 3) See 2). When I enumerate the ports on my Linux machine, the RS422 port shows up as a serial port. portList = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier foundPortId = null; while (portList.hasMoreElements()) { portId = (gnu.io.CommPortIdentifier) portList.nextElement(); int portType = portId.getPortType(); System.out.println("Found port " + portId.getName()); System.out.println(" of port type " + portId.getPortType()); if (portType == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { portFound = true; foundPortId = portId; } } } I hope this is the information that you requested. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:40 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Thu Jun 24 16:25:11 2010 From: jredman at ergotech.com (Jim Redman) Date: Thu, 24 Jun 2010 16:25:11 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C23DB47.5070308@ergotech.com> RS485 has a 2-wire, half-duplex mode. In this case you need a mechanism to switch sender and receiver. In many cases, the RS485 port will do this for you. Most RS232<->RS485 converters will also manage the switching in a way that is totally transparent to you. In principle, if you don't have a port that handles switching automatically for you, you could control this switching in software. Realistically, unless you have a long delay between sending and reply generation, say 100ms or more, it would be difficult. With most system, the response comes back very quickly and user level code will be too slow to manage that. I think that RS422 is always 4-wire. From the software standpoint, it, and 4-wire RS422 (and current loop and ...) all look the same. There are some electrical issues with RS422 and RS485 particularly termination. I haven't hooked up 485 or 422 in a while so I don't remember all the details, but if you get it wrong it probably won't work. Jim On 06/24/2010 12:39 PM, Mariusz Dec wrote: > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, > I have a 232 port and everything is wonderful. I set the 422 port > up similarly and see no events firing (except output buffer empty). > I set up a scope on the connector and copy a file to the port > (/dev/ttyS1 in my case) and see output. I do the same through RxTx > and see nothing. If this is a setup problem, I am confused as I set > the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so > that I can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From mariusz.dec at gmail.com Fri Jun 25 01:52:48 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 25 Jun 2010 09:52:48 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, now you are sleeping and I have the next day :) So - "voltage interface" means that you have RS232 interface and voltage level converter to use it as RS422. In such case proper work of the RS232 determines proper work of the RS422 (if hw works). In case you make tests on physically different controllers, there may be a lot of traps more, especially now, when we have milions of USB/RS232 dongles vendors and milions of not-properly-working VCP-drivers. Your sentence: "dongle and a RS232 to RS422 converter hooked to" says that you have one RS232 controller and you are using "voltage interface" named >converter< to connect to external RS422 source. It means that only problem is somewhere on the physical part of the interface. If you are seeing signals on the scope, means that you may send dat ok. if you have checked that your USB-serial dongle works good with events, look for the hw mistakes (wiring etc). If you haven't yet checked if your USB-serial dongle works good with events read this: http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html AND always remember that USB-serial dongle isn't serial COM port, this is VIRTUAL Com Port. And this may make a big difference... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t function. > I am then trying to debug 2 sets of code, instead of working from a good set > to get my ?bad? set to work correctly. > > > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on the > transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is parsing > the messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up as > a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:40 PM > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't > the same ? > > Regards > Mariusz > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Fri Jun 25 01:54:39 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 25 Jun 2010 08:54:39 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: <4C23DB47.5070308@ergotech.com> References: <4C23DB47.5070308@ergotech.com> Message-ID: I'm happily using RXTX to communicate with RS422 devices in 4-wire mode using KK-Systems K2 RS232-RS422/RS485 converters (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). Running at 115200 baud -- no issues at all. Regards, Michael Erskine. From jredman at ergotech.com Fri Jun 25 11:29:10 2010 From: jredman at ergotech.com (Jim Redman) Date: Fri, 25 Jun 2010 11:29:10 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <4C23DB47.5070308@ergotech.com> Message-ID: <4C24E766.50102@ergotech.com> Note that the K2 doesn't do automatic switching for RS485, the K2-ADE does. For true RS422 this is irrelevant. We've used a bunch of converters, including some USB versions, some from B&B (http://www.bb-elec.com/) and some (a lot?) of the non-name, low cost RS232-RS485 converters that are out there. There really is no difference as far as the software is concerned. The cabling and termination of 485/422 do tend to be more problematic, and it's likely that the problem lies there rather than anywhere else. Jim On 06/25/2010 01:54 AM, Michael Erskine wrote: > I'm happily using RXTX to communicate with RS422 devices in 4-wire > mode using KK-Systems K2 RS232-RS422/RS485 converters > (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). > Running at 115200 baud -- no issues at all. > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From robohobby at gmail.com Sun Jun 27 07:41:33 2010 From: robohobby at gmail.com (Oleg Lyubchenko) Date: Sun, 27 Jun 2010 17:41:33 +0400 Subject: [Rxtx] Is it possible to receive data from serial port, using RXTX under Linux? Message-ID: Hi, I am trying to use RxTx for a simple project. Small board ETX should communicate with several devices, using serial ports. The application should work under Linux. Java is my favorite language and that was the reason, why RXTX was selected for the task. Under Windows all was OK. But under Linux I see strange thing - It is possible to send data to the port, but it is impossible to read data from port under Linux. Lock files are OK - this part work as it should. User (the user is 'root') has permissions to read-write to port (to device). Kermit and minicom works fine with the modem. The application can send data, but can not read data. As a test example I use standard example class - TwoWaySerialComm.java . I tried both versions of this file - one version without Events and version with Events. I see the same picture with Puppy Linux, with Ubuntu 9.10, OpenSuSE 11. As a hardware I use ETX board and notebook Samsung R40. Both platforms shows the same result - can write to port, can not read from port. What I mean by "send and receive data": I do very simple test - after connection to the device I type "atz" and waiting for the answer from the modem. Normal answer should be "OK". Under Windows, using "TwoWaySerialComm" I see : ATZ ATZ OK Under Linux I see only ATZ ATZ (No normal answer 'OK') Any ideas? PS: If you want to see the code, you can download the code of the project from http://www.robohobby.com/downloads/JavaRxTx.zip There is nothing special there - just project for Netbeans with code of two standard examples. to run it under Windows, use JavaRxTx\r.bat for Linux, use JavaRxTx\sh r.sh Sincerely, Oleg -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at iDIAcomputing.com Sun Jun 27 08:16:25 2010 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 27 Jun 2010 10:16:25 -0400 Subject: [Rxtx] Is it possible to receive data from serial port, using RXTX under Linux? In-Reply-To: References: Message-ID: <4C275D39.3060005@iDIAcomputing.com> Oleg On 6/27/10 9:41 AM, Oleg Lyubchenko wrote: > Under Windows, using "TwoWaySerialComm" I see : > ATZ > ATZ > OK > > Under Linux > I see only > ATZ > ATZ > > (No normal answer 'OK') > > Any ideas? > > PS: If you want to see the code, you can download the code of the > project from > http://www.robohobby.com/downloads/JavaRxTx.zip > There is nothing special there - just project for Netbeans with code of > two standard examples. > > to run it under Windows, use > JavaRxTx\r.bat > for Linux, use JavaRxTx\sh r.sh Oleg, I've not looked at your code, but are you sending both a carriage return and a linefeed to the modem? Windows will generally send both for a \n but Linux will generally only send a linefeed. You may need to use \r\n to get both. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From djjames at drs-ssi.com Mon Jun 28 07:40:32 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Mon, 28 Jun 2010 08:40:32 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: All, I have a box that has RS422 native, the sender of some data. I have another box that has RS422 native. My software runs on this machine. This is where my problem lies. I think I confused the issue with my statement about the 422/232 converter. I have the converter in my test setup to make certain that the sender was sending what I expected, hooked to a laptop with hyperterm. The production setup will have no converters. It cannot have a converter. I have another box on which I have to communicate via RS232. I have that communications up and running. I get the correct information out of my RS232 link. +------+ RS422 +----+ RS232 +-------+ |Sender|-------| Me |-------|Another| +------+ +----+ | Sender| +-------+ On the scope, I have verified that the RS422 sender is setting the transmit lines correctly. I cannot get my side of the RS422 communications to work. I have set my RS422 configuration to be similar to the RS232 that does work. The only event that I am getting is output buffer empty, even though I have turned off that notification (422port.notifyOnOutputEmpty(false);). I have 422port.notifyOnDataAvilable(true), yet I never get that event. It doesn't seem that I have things setup correctly. I have configured the RS422 port per my interface spec with the RS422 sender, yet I don't get any data (no data available events!). If I can't get this to work, I will be writing my own (which isn't a nice thought). From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Friday, June 25, 2010 2:53 AM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, now you are sleeping and I have the next day :) So - "voltage interface" means that you have RS232 interface and voltage level converter to use it as RS422. In such case proper work of the RS232 determines proper work of the RS422 (if hw works). In case you make tests on physically different controllers, there may be a lot of traps more, especially now, when we have milions of USB/RS232 dongles vendors and milions of not-properly-working VCP-drivers. Your sentence: "dongle and a RS232 to RS422 converter hooked to" says that you have one RS232 controller and you are using "voltage interface" named >converter< to connect to external RS422 source. It means that only problem is somewhere on the physical part of the interface. If you are seeing signals on the scope, means that you may send dat ok. if you have checked that your USB-serial dongle works good with events, look for the hw mistakes (wiring etc). If you haven't yet checked if your USB-serial dongle works good with events read this: http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html AND always remember that USB-serial dongle isn't serial COM port, this is VIRTUAL Com Port. And this may make a big difference... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I agree with the RS422/RS485/RS232 control side being the same. Everything I have read says that this should be so. I did notice that there is a RS485 implementation within RxTx that RS485Port.java states is "Non functional". I was thinking that I could/should use the RS485 code as a basis for the RS422 code, if necessary. But this seems a rash course of action if it doesn't function. I am then trying to debug 2 sets of code, instead of working from a good set to get my "bad" set to work correctly. 1) I don't understand the first question "does your RS422 is voltage interface to RS232?" What is "is voltage"? What is an "is voltage interface"? I apologize for my ignorance about this. I have a "true" RS422 port, +/- 5 volt differential if that is what you mean. There is no cross talk between the RS232 and RS422 that I can detect. I know that the RS422 port works, from the command line I have copied a file to that tty device and see voltage changes on my scope on the transmit+ and transmit- pins. 2) No USB dongles are involved in the "badness". That said, as a test, I have run the target java code on a laptop with a USB to serial dongle and a RS232 to RS422 converter hooked to my RS422 source and the serial communications is great. I know that my messaging code is parsing the messages and that the RxTx RS232 code is getting the correct interrupts for the raw data to build the messages up from the raw data. 3) See 2). When I enumerate the ports on my Linux machine, the RS422 port shows up as a serial port. portList = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier foundPortId = null; while (portList.hasMoreElements()) { portId = (gnu.io.CommPortIdentifier) portList.nextElement(); int portType = portId.getPortType(); System.out.println("Found port " + portId.getName()); System.out.println(" of port type " + portId.getPortType()); if (portType == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { portFound = true; foundPortId = portId; } } } I hope this is the information that you requested. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:40 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Jun 28 08:18:08 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 28 Jun 2010 17:18:08 +0300 Subject: [Rxtx] Port to RS422? In-Reply-To: Message-ID: > If I can?t get this to work, I will be writing my own (which isn?t a nice > thought). As stated, from the software point of view RSxxx are identical (or if there is a critical difference lurking somewhere in the details, you are screwed), so I would think that if you roll your own you will run into a similar problem that you are having with rxtx, thus is makes sense to figure out first *what* is the problem here, and then see if you need to write your own. Just my 2 snt, but I've been there, done that. br Kusti From jredman at ergotech.com Mon Jun 28 12:32:38 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 28 Jun 2010 12:32:38 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C28EAC6.8030908@ergotech.com> RS422 is multi-drop. If you just want to monitor what is going on (for debugging or other reasons) connect the two native RS422 systems together (if you can test that these are working at this point so much the better) then add the RS422 converter to the same lines - no need for a pass through. So you'll have: | RS422 |-------------------| RS422 | | | [ RS422 Converter ] The converter will see all traffic and can talk on the line (but that might confuse the other two components. Jim On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From jredman at ergotech.com Mon Jun 28 12:43:57 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 28 Jun 2010 12:43:57 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C28ED6D.2040807@ergotech.com> Just out of interest, what's the make/model of RS422 converter you're using? On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From andy at g0poy.com Mon Jun 28 15:12:00 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 28 Jun 2010 22:12:00 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <20100628221200.6ca3052d@workstation.site> Try TeraTerm rather than Hyperterm just in case that is the problem. http://www.ayera.com/teraterm/ I have known Hyperterm to do all sorts of things you don't tell it. (We gave up asking customers to use it) Sometimes it would receive OK, other times not. We never found out exactly what upset it. Generally we would be using it at 9600 8N1 so nothing special at all. After switching to TeraTerm we have no more problems. Andy On Mon, 28 Jun 2010 08:40:32 -0500 "James, David (DJ) (SA-1)" wrote: > All, > > > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > > > > > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > > > I cannot get my side of the RS422 communications to work. I have set > my RS422 configuration to be similar to the RS232 that does work. The > only event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn't seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don't get > any data (no data available events!). > > > > If I can't get this to work, I will be writing my own (which isn't a > nice thought). > > > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Friday, June 25, 2010 2:53 AM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and > voltage level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is "Non functional". I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn't > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my "bad" set to work correctly. > > > > 1) I don't understand the first question "does your RS422 is > voltage interface to RS232?" What is "is voltage"? What is an "is > voltage interface"? I apologize for my ignorance about this. > > > > I have a "true" RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the "badness". That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is > parsing the messages and that the RxTx RS232 code is getting the correct > interrupts for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:40 PM > > > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. > If this is a setup problem, I am confused as I set the two ports up > similarly. > > > > Thanks, > > DJ > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:18 PM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > From djjames at drs-ssi.com Mon Jun 28 15:28:24 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Mon, 28 Jun 2010 16:28:24 -0500 Subject: [Rxtx] RS422 converter model and (maybe) resolution. In-Reply-To: References: Message-ID: B&B Electronics 422PP9R. Things work great with it. It now appears to be the box. We were able to get another one in for testing and BlockBox is getting events as it should. He suggestion that it might be hardware was spot on. But (of course), you want to make certain that your stuff is working correctly before you accuse the other side of any wrong doing. Thanks for all the advice! DJ -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Monday, June 28, 2010 3:26 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 34, Issue 11 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. Re: Port to RS422? (Kustaa Nyholm) 2. Re: Port to RS422? (Jim Redman) 3. Re: Port to RS422? (Jim Redman) 4. Re: Port to RS422? (Andy Eskelson) ---------------------------------------------------------------------- Message: 1 Date: Mon, 28 Jun 2010 17:18:08 +0300 From: Kustaa Nyholm To: "rxtx at qbang.org" Subject: Re: [Rxtx] Port to RS422? Message-ID: Content-Type: text/plain; charset="iso-8859-1" > If I can?t get this to work, I will be writing my own (which isn?t a nice > thought). As stated, from the software point of view RSxxx are identical (or if there is a critical difference lurking somewhere in the details, you are screwed), so I would think that if you roll your own you will run into a similar problem that you are having with rxtx, thus is makes sense to figure out first *what* is the problem here, and then see if you need to write your own. Just my 2 snt, but I've been there, done that. br Kusti ------------------------------ Message: 2 Date: Mon, 28 Jun 2010 12:32:38 -0600 From: Jim Redman To: RXTX Developers and Users Subject: Re: [Rxtx] Port to RS422? Message-ID: <4C28EAC6.8030908 at ergotech.com> Content-Type: text/plain; charset=windows-1252; format=flowed RS422 is multi-drop. If you just want to monitor what is going on (for debugging or other reasons) connect the two native RS422 systems together (if you can test that these are working at this point so much the better) then add the RS422 converter to the same lines - no need for a pass through. So you'll have: | RS422 |-------------------| RS422 | | | [ RS422 Converter ] The converter will see all traffic and can talk on the line (but that might confuse the other two components. Jim On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com ------------------------------ Message: 3 Date: Mon, 28 Jun 2010 12:43:57 -0600 From: Jim Redman Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Message-ID: <4C28ED6D.2040807 at ergotech.com> Content-Type: text/plain; charset=windows-1252; format=flowed Just out of interest, what's the make/model of RS422 converter you're using? On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com ------------------------------ Message: 4 Date: Mon, 28 Jun 2010 22:12:00 +0100 From: Andy Eskelson To: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Message-ID: <20100628221200.6ca3052d at workstation.site> Content-Type: text/plain; charset=US-ASCII Try TeraTerm rather than Hyperterm just in case that is the problem. http://www.ayera.com/teraterm/ I have known Hyperterm to do all sorts of things you don't tell it. (We gave up asking customers to use it) Sometimes it would receive OK, other times not. We never found out exactly what upset it. Generally we would be using it at 9600 8N1 so nothing special at all. After switching to TeraTerm we have no more problems. Andy On Mon, 28 Jun 2010 08:40:32 -0500 "James, David (DJ) (SA-1)" wrote: > All, > > > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > > > > > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > > > I cannot get my side of the RS422 communications to work. I have set > my RS422 configuration to be similar to the RS232 that does work. The > only event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn't seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don't get > any data (no data available events!). > > > > If I can't get this to work, I will be writing my own (which isn't a > nice thought). > > > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Friday, June 25, 2010 2:53 AM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and > voltage level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is "Non functional". I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn't > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my "bad" set to work correctly. > > > > 1) I don't understand the first question "does your RS422 is > voltage interface to RS232?" What is "is voltage"? What is an "is > voltage interface"? I apologize for my ignorance about this. > > > > I have a "true" RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the "badness". That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is > parsing the messages and that the RxTx RS232 code is getting the correct > interrupts for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:40 PM > > > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. > If this is a setup problem, I am confused as I set the two ports up > similarly. > > > > Thanks, > > DJ > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:18 PM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > 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 End of Rxtx Digest, Vol 34, Issue 11 ************************************ From msemtd at googlemail.com Tue Jun 29 04:05:10 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 29 Jun 2010 11:05:10 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: <20100628221200.6ca3052d@workstation.site> References: <20100628221200.6ca3052d@workstation.site> Message-ID: On 28 June 2010 22:12, Andy Eskelson wrote: > Try TeraTerm rather than Hyperterm just in case that is the problem. > http://www.ayera.com/teraterm/ I recommend RealTerm over teraterm pro (proper FOSS licence, you get the source code, actively maintained, etc.): http://realterm.sourceforge.net/ Regards, Michael Erskine. From mariusz.dec at gmail.com Tue Jun 29 04:37:25 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 29 Jun 2010 12:37:25 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <20100628221200.6ca3052d@workstation.site> Message-ID: Hi, a bit from my experience :). I am using my own terminals only. Why? Because good transmission practice says that in data packet should be a header, trailer, checksum, block length etc. My terminals (software like Hyperterm) for each project have a simple current protocols parsers and shows important data in clear form. Additionally I can see whole time of the developing that second side of the transmission path works good as well (for example - good checksum arrives). Currently I am receiving /sendign quite large packets - about 50 bytes - how to look inside without tools? This is easy to write ad-hoc specialized terminal and this helps a lot :). Regards Mariusz 2010/6/29 Michael Erskine > On 28 June 2010 22:12, Andy Eskelson wrote: > > Try TeraTerm rather than Hyperterm just in case that is the problem. > > http://www.ayera.com/teraterm/ > > I recommend RealTerm over teraterm pro (proper FOSS licence, you get > the source code, actively maintained, etc.): > http://realterm.sourceforge.net/ > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Tue Jun 29 08:23:24 2010 From: jredman at ergotech.com (Jim Redman) Date: Tue, 29 Jun 2010 08:23:24 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <20100628221200.6ca3052d@workstation.site> Message-ID: <4C2A01DC.50200@ergotech.com> If you're on Windows and just trying to snoop the communications, then the Sysinternals "PortMon" can be useful: http://technet.microsoft.com/en-us/sysinternals/bb795533.aspx It looks as though RealTerm might have a similar feature. Jim On 06/29/2010 04:37 AM, Mariusz Dec wrote: > Hi, > a bit from my experience :). > > I am using my own terminals only. > Why? > Because good transmission practice says that in data packet should be a > header, trailer, checksum, block length etc. > My terminals (software like Hyperterm) for each project have a simple > current protocols parsers and shows important data in clear form. > Additionally I can see whole time of the developing that second side of > the transmission path works good as well (for example - good checksum > arrives). > Currently I am receiving /sendign quite large packets - about 50 bytes - > how to look inside without tools? > > This is easy to write ad-hoc specialized terminal and this helps a lot :). > > Regards > Mariusz > > > > 2010/6/29 Michael Erskine > > > On 28 June 2010 22:12, Andy Eskelson > wrote: > > Try TeraTerm rather than Hyperterm just in case that is the problem. > > http://www.ayera.com/teraterm/ > > I recommend RealTerm over teraterm pro (proper FOSS licence, you get > the source code, actively maintained, etc.): > http://realterm.sourceforge.net/ > > Regards, > Michael Erskine. > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From mariusz.dec at gmail.com Tue Jun 29 09:13:32 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Tue, 29 Jun 2010 17:13:32 +0200 Subject: [Rxtx] Port to RS422? References: <20100628221200.6ca3052d@workstation.site> <4C2A01DC.50200@ergotech.com> Message-ID: <260B5D1534CF44FF92AC19D9B016F177@mdam2> Hi, sysinternals has a lot of very usefull tools :). But in my projects binary data isn't enough when I receive some analog data from DAC's. This is voltage but as representation of temperature, pressure, voltage.... Easiest way is to do own terminal with simple parser. Now in the era of the USB/RS232 dongles another usefull tool is "just connected COM port finder"... I did it and work is comfortable - no more system crashes when disconecting USB while terminal is working. The most difficult was the first step after fight with Hyperterm few years ago... :) Regards :) Mariusz ----- Original Message ----- From: "Jim Redman" Cc: Sent: Tuesday, June 29, 2010 4:23 PM Subject: Re: [Rxtx] Port to RS422? > If you're on Windows and just trying to snoop the communications, then > the Sysinternals "PortMon" can be useful: > > http://technet.microsoft.com/en-us/sysinternals/bb795533.aspx > > It looks as though RealTerm might have a similar feature. > > Jim > > On 06/29/2010 04:37 AM, Mariusz Dec wrote: >> Hi, >> a bit from my experience :). >> >> I am using my own terminals only. >> Why? >> Because good transmission practice says that in data packet should be a >> header, trailer, checksum, block length etc. >> My terminals (software like Hyperterm) for each project have a simple >> current protocols parsers and shows important data in clear form. >> Additionally I can see whole time of the developing that second side of >> the transmission path works good as well (for example - good checksum >> arrives). >> Currently I am receiving /sendign quite large packets - about 50 bytes - >> how to look inside without tools? >> >> This is easy to write ad-hoc specialized terminal and this helps a lot :). >> >> Regards >> Mariusz >> >> >> >> 2010/6/29 Michael Erskine > > >> >> On 28 June 2010 22:12, Andy Eskelson > > wrote: >> > Try TeraTerm rather than Hyperterm just in case that is the problem. >> > http://www.ayera.com/teraterm/ >> >> I recommend RealTerm over teraterm pro (proper FOSS licence, you get >> the source code, actively maintained, etc.): >> http://realterm.sourceforge.net/ >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> 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 > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From andrea.antonello at gmail.com Tue Jun 29 14:39:49 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Tue, 29 Jun 2010 22:39:49 +0200 Subject: [Rxtx] wrapping rxtx in eclipse Message-ID: Hi developers, I am currently using rxtx in an eclipse based GIS project to connect to GPS via bluetooth. I found the http://rxtx.qbang.org/wiki/index.php/Wrapping_RXTX_in_an_Eclipse_Plugin page a great start to maintain platform "independency". We are currently working on eclipse 3.6 and created the rxtx plugins as they suggest to do them now using plugins and fragments. Currently the namespace of the plugin is ours with authors rxtx.org. I was thinking it probably would make more sense to create them with the rxtx namespace and make them downloadable here? So finally the question: - is it ok if I update the above wiki page with eclipse 3.6 instructions? - would there be interst for me maintaining the eclipse plugins for rxtx? - is it ok to add my project to the projects using rxtx? That's all, best regards, Andrea From karl.weber99 at gmx.net Wed Jun 30 03:17:26 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 30 Jun 2010 11:17:26 +0200 Subject: [Rxtx] wrapping rxtx in eclipse In-Reply-To: References: Message-ID: <201006301117.26265.karl.weber99@gmx.net> Am Dienstag, 29. Juni 2010 22:39 schrieb andrea antonello: > Hi developers, > I am currently using rxtx in an eclipse based GIS project to connect > to GPS via bluetooth. > I found the > http://rxtx.qbang.org/wiki/index.php/Wrapping_RXTX_in_an_Eclipse_Plugin > page a great start to maintain platform "independency". > > We are currently working on eclipse 3.6 and created the rxtx plugins > as they suggest to do them now using plugins and fragments. > Currently the namespace of the plugin is ours with authors rxtx.org. I > was thinking it probably would make more sense to create them with the > rxtx namespace and make them downloadable here? > So finally the question: > - is it ok if I update the above wiki page with eclipse 3.6 instructions? > - would there be interst for me maintaining the eclipse plugins for rxtx? > - is it ok to add my project to the projects using rxtx? > I am no OSGi expert, but if you think about maintaining an eclipse-plugin for rxtx, I would suggest a better solution, which should work, as far as I understand OSGi: (1) Create an OSGi-bundle. What I mean here is, that one should not use any eclipse / equinox specific stuff, so that this bundle can be used with other OSGi-frameworks as well. (2) Do not create a wrapper. If only java-classes where involved, the difference between an OSGi-Bundle and an ordinary jar-file was only some entries in the MANIFEST-header. So, instead of heaving a jar within a jar, I would prefer to have only one jar that is an OSGi-Bundle. Such OSGi-Bundle can also be used outside of any OSGi-framework, as ordinary jar-file. That rxtx involves c-libraries should not make much difference. In addition to the java-classes the (single) jar should also contain the libs. It would also be nice, to enhance the rxtx build-service, such that it can create such OSGi-bundles from the sources. /Karl P.S. I am currently also using a wrapper plug-in, but I am not happy with this solution... From andrea.antonello at gmail.com Wed Jun 30 04:07:24 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Wed, 30 Jun 2010 12:07:24 +0200 Subject: [Rxtx] wrapping rxtx in eclipse In-Reply-To: <201006301117.26265.karl.weber99@gmx.net> References: <201006301117.26265.karl.weber99@gmx.net> Message-ID: Hi Karl, I think your suggestions are good. The problem is that I am also no Osgi specialist. I can ensure a continuity in maintainment and bugfixes only by proposing something I would do anyways, which is keeping up the plugins and fragments for my project. For something something different I am afraid that after few time it would get of low priority in my list of job tasks and I prefer to not take that path. Andrea On Wed, Jun 30, 2010 at 11:17 AM, Karl Weber wrote: > Am Dienstag, 29. Juni 2010 22:39 schrieb andrea antonello: >> Hi developers, >> I am currently using rxtx in an eclipse based GIS project to connect >> to GPS via bluetooth. >> I found the >> http://rxtx.qbang.org/wiki/index.php/Wrapping_RXTX_in_an_Eclipse_Plugin >> page a great start to maintain platform "independency". >> >> We are currently working on eclipse 3.6 and created the rxtx plugins >> as they suggest to do them now using plugins and fragments. >> Currently the namespace of the plugin is ours with authors rxtx.org. I >> was thinking it probably would make more sense to create them with the >> rxtx namespace and make them downloadable here? >> So finally the question: >> - is it ok if I update the above wiki page with eclipse 3.6 instructions? >> - would there be interst for me maintaining the eclipse plugins for rxtx? >> - is it ok to add my project to the projects using rxtx? >> > > I am no OSGi expert, but if you think about maintaining an eclipse-plugin for > rxtx, I would suggest a better solution, which should work, as far as I > understand OSGi: > > (1) Create an OSGi-bundle. What I mean here is, that one should not use any > eclipse / equinox specific stuff, so that this bundle can be used with other > OSGi-frameworks as well. > > (2) Do not create a wrapper. If only java-classes where involved, the > difference between an OSGi-Bundle and an ordinary jar-file was only some > entries in the MANIFEST-header. So, instead of heaving a jar within a jar, I > would prefer to have only one jar that is an OSGi-Bundle. Such OSGi-Bundle > can also be used outside of any OSGi-framework, as ordinary jar-file. > > That rxtx involves c-libraries should not make much difference. In addition to > the java-classes the (single) jar should also contain the libs. > > It would also be nice, to enhance the rxtx build-service, such that it can > create such OSGi-bundles from the sources. > > /Karl > > > P.S. I am currently also using a wrapper plug-in, but I am not happy with this > solution... > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From leo.guimaraes at gmail.com Fri Jun 18 13:29:14 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Fri, 18 Jun 2010 15:29:14 -0400 Subject: [Rxtx] Virtual Port with RXTX Message-ID: Hello everybody, Please, im crazy trying to solve this problem: I created a virtual port in my server to receive data over the ethernet from a serial port in the client machine. Im using socat for that: In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: 192.168.102.41:54321 its working fine for me, accessing the virtual port via CuteCom or any terminal. But i can't access this port via RXTX. The getPortIdentifiers() method returns only the /dev/ttyS0 port. Please guys, could you help me about that? Thank you very much! Leandro Guimar?es -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Fri Jun 18 23:43:50 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 19 Jun 2010 07:43:50 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: Hi, In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: > 192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or any > terminal. But i can't access this port via RXTX. The getPortIdentifiers() > method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock Try to change name of the virtual port. I suppose you are using Linux, so: In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid prefixes for the Linux com ports. Add your prefix there or change your VCP name to match to any predefined prefix there. Regards Mariusz > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Sat Jun 19 08:03:06 2010 From: jredman at ergotech.com (Jim Redman) Date: Sat, 19 Jun 2010 08:03:06 -0600 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: <4C1CCE1A.90201@ergotech.com> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports so: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 or whatever you need for the virtual port. The ports will enumerate in the order give (I don't know whether this is a guaranteed behavior or just the way it happens to be). Jim On 06/18/2010 11:43 PM, Mariusz Dec wrote: > Hi, > > In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > tcp:192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or > any terminal. But i can't access this port via RXTX. The > getPortIdentifiers() method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork > file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > > Try to change name of the virtual port. > > I suppose you are using Linux, so: > > In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > prefixes for the Linux com ports. > Add your prefix there or change your VCP name to match to any predefined > prefix there. > > Regards > Mariusz > > > > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From leo.guimaraes at gmail.com Mon Jun 21 13:23:26 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 16:23:26 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: <4C1CCE1A.90201@ergotech.com> References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hello, Change my virtual port to ttySXX worked fine... But now, im having another problem... I dont know why, but the virtual port is never calling the SerialEvent in the SerialPortEventListenner... using the real Serial port, works fine. But it doesnt work with the virtual port... Somebody have an idea?? Pleasse! Thank you!! Leandro Guimar?es On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: > You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > so: > > > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > > or whatever you need for the virtual port. The ports will enumerate in the > order give (I don't know whether this is a guaranteed behavior or just the > way it happens to be). > > Jim > > > > > On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> Hi, >> >> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave >> tcp:192.168.102.41:54321 >> >> >> its working fine for me, accessing the virtual port via CuteCom or >> any terminal. But i can't access this port via RXTX. The >> getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >> Please guys, could you help me about that? >> >> >> In client machine: socat tcp-l:54321,reuseaddr,fork >> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >> Try to change name of the virtual port. >> >> I suppose you are using Linux, so: >> >> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> prefixes for the Linux com ports. >> Add your prefix there or change your VCP name to match to any predefined >> prefix there. >> >> Regards >> Mariusz >> >> >> >> Thank you very much! >> Leandro Guimar?es >> >> >> _______________________________________________ >> 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 >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > > _______________________________________________ > 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 Mon Jun 21 13:47:13 2010 From: george.dma at gmail.com (George H) Date: Mon, 21 Jun 2010 19:47:13 +0000 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, This might be because it is a virtual port. I used to do testing on usb/serial port and there were some "signals" it would not send me that a real serial port would. Try to see what signals your serial port sends you that the virtual port doesn't. I think there are some serial port sniffers out there where you can intercept the signals. Also would do good if you look at some technical tutorials on how serial port signals work. A good site which I read over many times to try to understand why things are the way they are is http://www.arcelect.com/rs232.htm I hope this gave you some ideas. Good luck -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Hello, > > ?? Change my virtual port to ttySXX worked fine... > > ?? But now, im having another problem... > > ? I dont know why, but the virtual port is never calling the SerialEvent in > the SerialPortEventListenner... using the real Serial port, works fine. But > it doesnt work with the virtual port... > > > ?? Somebody have an idea?? Pleasse! > > Thank you!! > Leandro Guimar?es > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports >> so: >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> the order give (I don't know whether this is a guaranteed behavior or just >> the way it happens to be). >> >> Jim >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >>> >>> Hi, >>> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >>> ? ?tcp:192.168.102.41:54321 >>> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >>> ? ?any terminal. But i can't access this port via RXTX. The >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >>> >>> ? ? ? Please guys, could you help me about that? >>> >>> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >>> >>> Try to change name of the virtual port. >>> >>> I suppose you are using Linux, so: >>> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >>> prefixes for the Linux com ports. >>> Add your prefix there or change your VCP name to match to any predefined >>> prefix there. >>> >>> Regards >>> Mariusz >>> >>> >>> >>> ? ?Thank you very much! >>> ? ?Leandro Guimar?es >>> >>> >>> ? ?_______________________________________________ >>> ? ?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 >> >> -- >> Jim Redman >> (505) 662 5156 x85 >> http://www.ergotech.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From leo.guimaraes at gmail.com Mon Jun 21 14:56:15 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 17:56:15 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Thanks George, Please, do you know what represents a "data available" in RXTX? Wich signal calls the Listener's Notify? Its the last thing that i need to do to finish my project here! Thank you very much! Leandro Guimar?es 2010/6/21 George H > Hi, > > This might be because it is a virtual port. > I used to do testing on usb/serial port and there were some "signals" > it would not send me that a real serial port would. > Try to see what signals your serial port sends you that the virtual > port doesn't. I think there are some serial port sniffers out there > where you can intercept the signals. Also would do good if you look at > some technical tutorials on how serial port signals work. > > A good site which I read over many times to try to understand why > things are the way they are is http://www.arcelect.com/rs232.htm > > I hope this gave you some ideas. > Good luck > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Hello, > > > > Change my virtual port to ttySXX worked fine... > > > > But now, im having another problem... > > > > I dont know why, but the virtual port is never calling the SerialEvent > in > > the SerialPortEventListenner... using the real Serial port, works fine. > But > > it doesnt work with the virtual port... > > > > > > Somebody have an idea?? Pleasse! > > > > Thank you!! > > Leandro Guimar?es > > > > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > wrote: > >> > >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > >> so: > >> > >> > >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> > >> or whatever you need for the virtual port. The ports will enumerate in > >> the order give (I don't know whether this is a guaranteed behavior or > just > >> the way it happens to be). > >> > >> Jim > >> > >> > >> > >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >>> > >>> Hi, > >>> > >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >>> tcp:192.168.102.41:54321 > >>> > >>> its working fine for me, accessing the virtual port via CuteCom or > >>> any terminal. But i can't access this port via RXTX. The > >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >>> > >>> Please guys, could you help me about that? > >>> > >>> > >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >>> > >>> Try to change name of the virtual port. > >>> > >>> I suppose you are using Linux, so: > >>> > >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >>> prefixes for the Linux com ports. > >>> Add your prefix there or change your VCP name to match to any > predefined > >>> prefix there. > >>> > >>> Regards > >>> Mariusz > >>> > >>> > >>> > >>> Thank you very much! > >>> Leandro Guimar?es > >>> > >>> > >>> _______________________________________________ > >>> 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 > >> > >> -- > >> Jim Redman > >> (505) 662 5156 x85 > >> http://www.ergotech.com > >> _______________________________________________ > >> 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 george.dma at gmail.com Mon Jun 21 22:51:50 2010 From: george.dma at gmail.com (George H) Date: Tue, 22 Jun 2010 07:51:50 +0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Did you read the site I posted? If you did you would have figured out which pin signal on the RS232 interface most likely triggers the data available event. It might be pin 2 and it might be pin 3, depends what kind of serial port you have and the cable. Plus i'm no expert on on RS-232 interfaces, I just know that if I have my hardware in front of me, and the source code of rxtx and a rs-232 specifications sheet then I can debug the problem and find out. This is what I believe you should do to get started to find out the "what, where and why" of your problem. -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Thanks George, > > ?? Please, do you know what represents a "data available" in RXTX? Wich > signal calls the Listener's Notify? > > ?? Its the last thing that i need to do to finish my project here! > > Thank you very much! > > Leandro Guimar?es > > > 2010/6/21 George H >> >> Hi, >> >> This might be because it is a virtual port. >> I used to do testing on usb/serial port and there were some "signals" >> it would not send me that a real serial port would. >> Try to see what signals your serial port sends you that the virtual >> port doesn't. I think there are some serial port sniffers out there >> where you can intercept the signals. Also would do good if you look at >> some technical tutorials on how serial port signals work. >> >> A good site which I read over many times to try to understand why >> things are the way they are is http://www.arcelect.com/rs232.htm >> >> I hope this gave you some ideas. >> Good luck >> -- >> George H >> george.dma at gmail.com >> >> >> >> 2010/6/21 Leandro Guimar?es : >> > Hello, >> > >> > ?? Change my virtual port to ttySXX worked fine... >> > >> > ?? But now, im having another problem... >> > >> > ? I dont know why, but the virtual port is never calling the SerialEvent >> > in >> > the SerialPortEventListenner... using the real Serial port, works fine. >> > But >> > it doesnt work with the virtual port... >> > >> > >> > ?? Somebody have an idea?? Pleasse! >> > >> > Thank you!! >> > Leandro Guimar?es >> > >> > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman >> > wrote: >> >> >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of >> >> ports >> >> so: >> >> >> >> >> >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> >> the order give (I don't know whether this is a guaranteed behavior or >> >> just >> >> the way it happens to be). >> >> >> >> Jim >> >> >> >> >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >> >>> >> >>> Hi, >> >>> >> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >> >>> ? ?tcp:192.168.102.41:54321 >> >>> >> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >> >>> ? ?any terminal. But i can't access this port via RXTX. The >> >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >>> >> >>> ? ? ? Please guys, could you help me about that? >> >>> >> >>> >> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >>> >> >>> Try to change name of the virtual port. >> >>> >> >>> I suppose you are using Linux, so: >> >>> >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> >>> prefixes for the Linux com ports. >> >>> Add your prefix there or change your VCP name to match to any >> >>> predefined >> >>> prefix there. >> >>> >> >>> Regards >> >>> Mariusz >> >>> >> >>> >> >>> >> >>> ? ?Thank you very much! >> >>> ? ?Leandro Guimar?es >> >>> >> >>> >> >>> ? ?_______________________________________________ >> >>> ? ?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 >> >> >> >> -- >> >> Jim Redman >> >> (505) 662 5156 x85 >> >> http://www.ergotech.com >> >> _______________________________________________ >> >> Rxtx mailing list >> >> Rxtx at qbang.org >> >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > >> > _______________________________________________ >> > Rxtx mailing list >> > Rxtx at qbang.org >> > http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > > > From mariusz.dec at gmail.com Tue Jun 22 05:32:01 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 22 Jun 2010 13:32:01 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, I am working with virtual ports only. Because of some problems with events I have changed whole idea. I did a thread in Java which is looking for port data in pool. If data comes in, I parse it and than generate an Java exception for the application. This works very good from several months and has an advantage more - is faster than events services. I have published many times an example code. Look for 2009'november thread "RXTX close() problem solved". In this example you can set Exception generation in read thread. There is a lot of "try-catch" loops which prevents system while you disconnect USB as well. For me works very good in Mac/Linux and Windows. Regards Mariusz 2010/6/22 George H > Did you read the site I posted? If you did you would have figured out > which pin signal on the RS232 interface most likely triggers the data > available event. > It might be pin 2 and it might be pin 3, depends what kind of serial > port you have and the cable. > > Plus i'm no expert on on RS-232 interfaces, I just know that if I have > my hardware in front of me, and the source code of rxtx and a rs-232 > specifications sheet then I can debug the problem and find out. This > is what I believe you should do to get started to find out the "what, > where and why" of your problem. > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Thanks George, > > > > Please, do you know what represents a "data available" in RXTX? Wich > > signal calls the Listener's Notify? > > > > Its the last thing that i need to do to finish my project here! > > > > Thank you very much! > > > > Leandro Guimar?es > > > > > > 2010/6/21 George H > >> > >> Hi, > >> > >> This might be because it is a virtual port. > >> I used to do testing on usb/serial port and there were some "signals" > >> it would not send me that a real serial port would. > >> Try to see what signals your serial port sends you that the virtual > >> port doesn't. I think there are some serial port sniffers out there > >> where you can intercept the signals. Also would do good if you look at > >> some technical tutorials on how serial port signals work. > >> > >> A good site which I read over many times to try to understand why > >> things are the way they are is http://www.arcelect.com/rs232.htm > >> > >> I hope this gave you some ideas. > >> Good luck > >> -- > >> George H > >> george.dma at gmail.com > >> > >> > >> > >> 2010/6/21 Leandro Guimar?es : > >> > Hello, > >> > > >> > Change my virtual port to ttySXX worked fine... > >> > > >> > But now, im having another problem... > >> > > >> > I dont know why, but the virtual port is never calling the > SerialEvent > >> > in > >> > the SerialPortEventListenner... using the real Serial port, works > fine. > >> > But > >> > it doesnt work with the virtual port... > >> > > >> > > >> > Somebody have an idea?? Pleasse! > >> > > >> > Thank you!! > >> > Leandro Guimar?es > >> > > >> > > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > >> > wrote: > >> >> > >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of > >> >> ports > >> >> so: > >> >> > >> >> > >> >> > >> >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> >> > >> >> or whatever you need for the virtual port. The ports will enumerate > in > >> >> the order give (I don't know whether this is a guaranteed behavior or > >> >> just > >> >> the way it happens to be). > >> >> > >> >> Jim > >> >> > >> >> > >> >> > >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> >>> > >> >>> Hi, > >> >>> > >> >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >> >>> tcp:192.168.102.41:54321 > >> >>> > >> >>> its working fine for me, accessing the virtual port via CuteCom > or > >> >>> any terminal. But i can't access this port via RXTX. The > >> >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >> >>> > >> >>> Please guys, could you help me about that? > >> >>> > >> >>> > >> >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >> >>> > >> >>> Try to change name of the virtual port. > >> >>> > >> >>> I suppose you are using Linux, so: > >> >>> > >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >> >>> prefixes for the Linux com ports. > >> >>> Add your prefix there or change your VCP name to match to any > >> >>> predefined > >> >>> prefix there. > >> >>> > >> >>> Regards > >> >>> Mariusz > >> >>> > >> >>> > >> >>> > >> >>> Thank you very much! > >> >>> Leandro Guimar?es > >> >>> > >> >>> > >> >>> _______________________________________________ > >> >>> 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 > >> >> > >> >> -- > >> >> Jim Redman > >> >> (505) 662 5156 x85 > >> >> http://www.ergotech.com > >> >> _______________________________________________ > >> >> 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 > >> > > >> > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Tue Jun 22 07:20:17 2010 From: showard314 at gmail.com (Scott Howard) Date: Tue, 22 Jun 2010 09:20:17 -0400 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails Message-ID: This is forwarded from: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472053 by Jan Niehusmann I tried putting this on the bug tracker but I couldn't get access In the static initializer of gnu.io.RXTXPort, an exception when initializing the static variable 'z' is silently discarded: try { z = new Zystem(); } catch ( Exception e ) {}; This leads to NullPointerExceptions later, which are difficult to debug as the original exception is lost. I did change the code to try { z = new Zystem(); } catch ( Exception e ) { throw new Error(e.toString()); }; for debugging. Probably a more specific exception would be more appropriate, but the point is that leaving z undefined without reporting an error makes debugging unnecessarily difficult. Thanks. From g3vbv at blueyonder.co.uk Tue Jun 22 19:20:11 2010 From: g3vbv at blueyonder.co.uk (Sid Boyce) Date: Wed, 23 Jun 2010 02:20:11 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar Message-ID: <4C21614B.3060504@blueyonder.co.uk> I am using openSUSE 11.3 RC1. "rfcomm -a" lists no devices From dmesg =========== [288811.093151] usb 2-4.4.2: new full speed USB device using ehci_hcd and address 16 [288811.207421] usb 2-4.4.2: New USB device found, idVendor=0403, idProduct=6001 [288811.207431] usb 2-4.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [288811.207438] usb 2-4.4.2: Product: FT232R USB UART [288811.207443] usb 2-4.4.2: Manufacturer: FTDI [288811.207447] usb 2-4.4.2: SerialNumber: A100efz7 [288811.210509] ftdi_sio 2-4.4.2:1.0: FTDI USB Serial Device converter detected [288811.210534] usb 2-4.4.2: Detected FT232RL [288811.210536] usb 2-4.4.2: Number of endpoints 2 [288811.210538] usb 2-4.4.2: Endpoint 1 MaxPacketSize 64 [288811.210540] usb 2-4.4.2: Endpoint 2 MaxPacketSize 64 [288811.210541] usb 2-4.4.2: Setting MaxPacketSize 64 [288811.210822] usb 2-4.4.2: FTDI USB Serial Device converter now attached to ttyUSB1 Package built and installed OK in /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/amd64, it also installed /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/RXTXcomm.jar slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar RXTXcomm.jar Failed to load Main-Class manifest attribute from RXTXcomm.jar # rpm -qa |grep java java-1_6_0-sun-1.6.0.u20-1.15.x86_64 gcc44-java-4.4.2_20100116-1.2.x86_64 netbeans-javaparser-6.8-1.1.noarch gcc45-java-4.5.0_20100604-1.1.x86_64 ant-javadoc-1.7.1-11.1.noarch javahelp2-2.0.05-6.28.noarch gcc43-java-4.3.4_20091019-2.25.x86_64 gcc-java-4.5-5.2.x86_64 java-ca-certificates-1-5.1.noarch java-1_6_0-sun-devel-1.6.0.u20-1.15.x86_64 lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> echo $JAVA_HOME /usr/lib64/jvm/java-1.6.0-sun-1.6.0 > l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/amd64/ total 6440 drwxr-xr-x 8 root root 4096 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ drwxr-xr-x 2 root root 23 2010-06-18 16:41 headless/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 jli/ -rw-r--r-- 1 root root 652 2010-04-12 22:00 jvm.cfg -rwxr-xr-x 1 root root 15836 2010-04-12 22:25 libattach.so* -rwxr-xr-x 1 root root 757091 2010-04-12 22:25 libawt.so* -rwxr-xr-x 1 root root 413267 2010-04-12 22:25 libcmm.so* -rwxr-xr-x 1 root root 217736 2010-04-12 22:25 libdcpr.so* -rwxr-xr-x 1 root root 120029 2010-04-12 22:30 libdeploy.so* -rwxr-xr-x 1 root root 21670 2010-04-12 22:25 libdt_socket.so* -rwxr-xr-x 1 root root 692649 2010-04-12 22:25 libfontmanager.so* -rwxr-xr-x 1 root root 237073 2010-04-12 22:25 libhprof.so* -rwxr-xr-x 1 root root 50085 2010-04-12 22:25 libinstrument.so* -rwxr-xr-x 1 root root 27244 2010-04-12 22:25 libioser12.so* -rwxr-xr-x 1 root root 46723 2010-04-12 22:25 libj2gss.so* -rwxr-xr-x 1 root root 14272 2010-04-12 22:25 libj2pcsc.so* -rwxr-xr-x 1 root root 78017 2010-04-12 22:25 libj2pkcs11.so* -rwxr-xr-x 1 root root 7980 2010-04-12 22:25 libjaas_unix.so* -rwxr-xr-x 1 root root 28919 2010-04-12 22:25 libjava_crw_demo.so* -rwxr-xr-x 1 root root 231135 2010-04-12 22:25 libjava.so* -rwxr-xr-x 1 root root 7099 2010-04-12 22:25 libjawt.so* -rwxr-xr-x 1 root root 293725 2010-04-12 22:25 libjdwp.so* -rwxr-xr-x 1 root root 224947 2010-04-12 22:25 libjpeg.so* -rwxr-xr-x 1 root root 10964 2010-04-12 22:25 libjsig.so* -rwxr-xr-x 1 root root 260521 2010-04-12 22:25 libjsound.so* -rwxr-xr-x 1 root root 37449 2010-04-12 22:25 libmanagement.so* -rwxr-xr-x 1 root root 734280 2010-04-12 22:25 libmlib_image.so* -rwxr-xr-x 1 root root 6667 2010-04-12 22:25 libnative_chmod_g.so* -rwxr-xr-x 1 root root 6571 2010-04-12 22:25 libnative_chmod.so* -rwxr-xr-x 1 root root 111945 2010-04-12 22:25 libnet.so* -rwxr-xr-x 1 root root 43716 2010-04-12 22:25 libnio.so* -rwxr-xr-x 1 root root 15651 2010-04-12 22:25 libnpt.so* -rwxr-xr-x 1 root root 6420 2010-04-12 22:25 librmi.so* -rwxr-xr-x 1 root root 77907 2010-06-18 16:56 librxtxI2C-2.2pre1.so* -rw-r--r-- 1 root root 97530 2010-06-18 16:56 librxtxI2C.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxI2C.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxI2C.so -> librxtxI2C-2.2pre1.so* -rwxr-xr-x 1 root root 55253 2010-06-18 16:56 librxtxParallel-2.2pre1.so* -rw-r--r-- 1 root root 66164 2010-06-18 16:56 librxtxParallel.a -rwxr-xr-x 1 root root 1035 2010-06-18 16:56 librxtxParallel.la* lrwxrwxrwx 1 root root 26 2010-06-18 16:56 librxtxParallel.so -> librxtxParallel-2.2pre1.so* -rwxr-xr-x 1 root root 79049 2010-06-18 16:56 librxtxRaw-2.2pre1.so* -rw-r--r-- 1 root root 100218 2010-06-18 16:56 librxtxRaw.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxRaw.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxRaw.so -> librxtxRaw-2.2pre1.so* -rwxr-xr-x 1 root root 78134 2010-06-18 16:56 librxtxRS485-2.2pre1.so* -rw-r--r-- 1 root root 98662 2010-06-18 16:56 librxtxRS485.a -rwxr-xr-x 1 root root 1014 2010-06-18 16:56 librxtxRS485.la* lrwxrwxrwx 1 root root 23 2010-06-18 16:56 librxtxRS485.so -> librxtxRS485-2.2pre1.so* -rwxr-xr-x 1 root root 192681 2010-06-18 16:56 librxtxSerial-2.2pre1.so* -rw-r--r-- 1 root root 267524 2010-06-18 16:56 librxtxSerial.a -rwxr-xr-x 1 root root 1021 2010-06-18 16:56 librxtxSerial.la* lrwxrwxrwx 1 root root 24 2010-06-18 16:56 librxtxSerial.so -> librxtxSerial-2.2pre1.so* -rwxr-xr-x 1 root root 48036 2010-04-12 22:25 libsaproc.so* -rwxr-xr-x 1 root root 294575 2010-04-12 22:25 libsplashscreen.so* -rwxr-xr-x 1 root root 134786 2010-04-12 22:25 libunpack.so* -rwxr-xr-x 1 root root 66292 2010-04-12 22:25 libverify.so* -rwxr-xr-x 1 root root 91191 2010-04-12 22:25 libzip.so* drwxr-xr-x 2 root root 23 2010-06-18 16:41 motif21/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 native_threads/ drwxr-xr-x 2 root root 56 2010-06-18 16:41 server/ -rw------- 1 root root 0 2010-06-18 16:53 stC2p3qT -rw------- 1 root root 0 2010-06-18 16:53 stJpl8lW -rw------- 1 root root 0 2010-06-18 16:53 stnb1qWY -rw------- 1 root root 0 2010-06-18 16:53 stYjTgRS -rw------- 1 root root 0 2010-06-18 16:53 stZA8aVV drwxr-xr-x 2 root root 23 2010-06-18 16:41 xawt/ lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/ total 1300 drwxr-xr-x 2 root root 125 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ -rw-r--r-- 1 root root 8239 2010-04-12 22:08 dnsns.jar -rw-r--r-- 1 root root 842216 2010-06-10 12:45 localedata.jar -rw-r--r-- 1 root root 429 2010-04-12 22:23 meta-index -rwxr-xr-x 1 root root 61389 2010-06-18 16:56 RXTXcomm.jar* -rw-r--r-- 1 root root 170239 2010-04-12 21:58 sunjce_provider.jar -rw-r--r-- 1 root root 230608 2010-04-12 22:08 sunpkcs11.jar Help appreciated. 73 ... Sid. -- Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support Specialist, Cricket Coach Microsoft Windows Free Zone - Linux used for all Computing Tasks From Kustaa.Nyholm at planmeca.com Tue Jun 22 23:38:46 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 08:38:46 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: Message-ID: > I did change the code to > try { > z = new Zystem(); > } catch ( Exception e ) { > throw new Error(e.toString()); > }; Is there a reason why this could/should not be: > try { > z = new Zystem(); > } catch ( Throwable e ) { > e.printStackTrace(System.err); > }; From msemtd at googlemail.com Wed Jun 23 02:14:25 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:14:25 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar In-Reply-To: <4C21614B.3060504@blueyonder.co.uk> References: <4C21614B.3060504@blueyonder.co.uk> Message-ID: On 23 June 2010 02:20, Sid Boyce wrote: > slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar > RXTXcomm.jar > Failed to load Main-Class manifest attribute from > RXTXcomm.jar > Help appreciated. > 73 ... Sid. Well Sid, it's pretty obvious to me: you're trying to launch a jar that doesn't contain a main(). What exactly are you trying to achieve by running "java -jar RXTXcomm.jar"? Regards, Michael Erskine. From msemtd at googlemail.com Wed Jun 23 02:17:11 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:17:11 +0100 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: On 23 June 2010 06:38, Kustaa Nyholm wrote: > >> I did change the code to >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >> ? ? ? ? ? ? ? ?}; > > Is there a reason why this could/should not be: > > >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >> ? ? ? ? ? ? ? ?}; Or even just let the exception bubble up and kill whatever thread caused the class to load :) I vote for the removal of Zystem BTW! Regards, Michael Erskine. From george.dma at gmail.com Wed Jun 23 02:34:07 2010 From: george.dma at gmail.com (George H) Date: Wed, 23 Jun 2010 11:34:07 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: -- George H george.dma at gmail.com On Wed, Jun 23, 2010 at 11:17 AM, Michael Erskine wrote: > On 23 June 2010 06:38, Kustaa Nyholm wrote: >> >>> I did change the code to >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >>> ? ? ? ? ? ? ? ?}; >> >> Is there a reason why this could/should not be: >> >> >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >>> ? ? ? ? ? ? ? ?}; > > Or even just let the exception bubble up and kill whatever thread > caused the class to load :) > > I vote for the removal of Zystem BTW! > > Regards, > Michael Erskine. I would prefer that an exception is thrown rather than the stack trace be printed. If anyone is using loggers then it would be useful to catch the exception and log it, rather than let it come out in the error stream where no one might look. From Steffen.DETTMER at ingenico.com Wed Jun 23 03:28:45 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 11:28:45 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: <20100623092844.GF20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 08:38 +0300: > > I did change the code to > > try { > > z = new Zystem(); > > } catch ( Exception e ) { > > throw new Error(e.toString()); > > }; > > Is there a reason why this could/should not be: > > > try { > > z = new Zystem(); > > } catch ( Throwable e ) { > > e.printStackTrace(System.err); > > }; Is this intentionally not throwing the exception? Well, then it still would be discarded (althrough not neccesarily silently :)). BTW, I don't think System.err is a good idea. It is `statically initialized'? I think then this means it is unclear who the caller is and who could catch this exception. Wouldn't it be better to store the exception in a member and throw it when needing Zystem (e.g. in new or open)? 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 Kustaa.Nyholm at planmeca.com Wed Jun 23 03:55:30 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 12:55:30 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: >> Is there a reason why this could/should not be: >> >>> try { >>> z = new Zystem(); >>> } catch ( Throwable e ) { >>> e.printStackTrace(System.err); >>> }; > > Is this intentionally not throwing the exception? Well, no, just a hasty reply from my part. > still would be discarded (althrough not neccesarily silently :)). > BTW, I don't think System.err is a good idea. > > It is `statically initialized'? I think then this means it is > unclear who the caller is and who could catch this exception. > Even so re-throwing the exception would make sense so that the application developer has a chance to handle this in whichever way they want. Of course logically this should not then print the stacktrace because that is the responsibility of the application developer. But so many do not handle these cases sensibly so from the application user point of view it is nice to have something on the console to aid in trouble shooting. Have not checked the context in which this happens so that might influence my opinion. > Wouldn't it be better to store the exception in a member and > throw it when needing Zystem (e.g. in new or open) I'm of the fail-fast school of thought so I think it should be reported and re-thrown as it happens, not later. br Kusti From pietro.galassi at gmail.com Wed Jun 23 05:59:29 2010 From: pietro.galassi at gmail.com (Pietro Galassi) Date: Wed, 23 Jun 2010 13:59:29 +0200 Subject: [Rxtx] Resource temporarily unavaible on writeByte() Message-ID: Hi, i have successfully installe RXTX 64bit version from UBUNTO repository. I wrote a simple test program and it shows i have 3 ports avaible on my system: /dev/ttyS1 - Serial /dev/ttyS0 - Serial /dev/lp0 - Parallel but as soon as i try to "writeByte" any data on the parallel port it always gives me: java.io.IOException: Resource temporarily unavaible on writeByte() My simple code is: ... outputStream = parallelPort.getOutputStream() ; System.out.println("Write..."); outputStream.write(88); outputStream.flush(); outputStream.close(); ... int mode = parallelPort.getMode(); gives always 0. Anyone can help pls ? Thanks a lot, Pietro Galassi -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Jun 23 10:35:37 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 18:35:37 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: <20100623163536.GI20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 12:55 +0300: > > Wouldn't it be better to store the exception in a member and > > throw it when needing Zystem (e.g. in new or open) > > I'm of the fail-fast school of thought so I think it should be > reported and re-thrown as it happens, not later. Ahh yes, I agree, in general it is much better to fail quick, loud and verbosely, right! However, if this is a static { } block, AFAIK it is not defined when it will be executed (Before application start? Or later, when loading the class later? Or when using it first time?). If the exception would be thrown before main() is called, I think it is difficult to catch it. I think some general global hook must be used to do so. Simpler to handle, if it is thrown when invocating some function, then it can be caught by try { } catch. (or am I wrong or outdated?) 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 rbreznak at neuronrobotics.com Wed Jun 23 11:46:21 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Wed, 23 Jun 2010 13:46:21 -0400 Subject: [Rxtx] Bundling native libraries Message-ID: Hello, I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. Has anyone had experience in doing this? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Wed Jun 23 18:26:17 2010 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 23 Jun 2010 17:26:17 -0700 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Whoops, forgot to copy this to the RXTX list ... ---------- Forwarded message ---------- From: Brian Schlining Date: Wed, Jun 23, 2010 at 11:11 Subject: Re: [Rxtx] Bundling native libraries To: "Breznak, Robert" Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a > one jar. Its to the point where I have an Ant script that pulls all of the > jars together, but I haven't been able to get the native libraries to work; > They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the > user to get and use. They don't need to worry about external dependencies > and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 24 00:37:35 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 24 Jun 2010 08:37:35 +0200 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Here is a snippet from my ant file. I actually unjar the rxtx jar file and add my own classes to it for Mac and WIndows. The snippet below is actually for Mac but just for your info I am using nsis and launch4j to create an exectuable for windows. I also copy the rxtx libs to the root folder of my application: On 24.06.2010, at 02:26, Brian Schlining wrote: > Whoops, forgot to copy this to the RXTX list ... > > ---------- Forwarded message ---------- > From: Brian Schlining > Date: Wed, Jun 23, 2010 at 11:11 > Subject: Re: [Rxtx] Bundling native libraries > To: "Breznak, Robert" > > > Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc > > On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 11:29:21 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 12:29:21 -0500 Subject: [Rxtx] Port to RS422? Message-ID: Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jun 24 12:18:10 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:18:10 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Thu Jun 24 12:22:15 2010 From: showard314 at gmail.com (Scott Howard) Date: Thu, 24 Jun 2010 14:22:15 -0400 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, On Thu, Jun 24, 2010 at 1:29 PM, James, David (DJ) (SA-1) wrote: > Has anyone tried porting RxTx to RS422? Don't know for sure but . . . > If not, where is all the C code for the other implementations so that I can > give it a shot? http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code There is a file called "PORTING" in the root of rxtx-devel Also refer to the (outdated) information on: http://users.frii.com/jarvi/rxtx/porting.html which has similar information to the PORTING file (trust the PORTING file in case of conflicts) I attached a copy of that file from the 2.2pre2 release to this email. Also, see the "toy box" section: http://rxtx.qbang.org/wiki/index.php/Download for compiled downloads on other platforms good luck. ~Scott -------------- next part -------------- A non-text attachment was scrubbed... Name: PORTING Type: application/octet-stream Size: 5017 bytes Desc: not available URL: From djjames at drs-ssi.com Thu Jun 24 12:22:52 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 13:22:52 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ 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 Jun 24 12:39:42 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:39:42 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 14:10:41 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 15:10:41 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I agree with the RS422/RS485/RS232 control side being the same. Everything I have read says that this should be so. I did notice that there is a RS485 implementation within RxTx that RS485Port.java states is "Non functional". I was thinking that I could/should use the RS485 code as a basis for the RS422 code, if necessary. But this seems a rash course of action if it doesn't function. I am then trying to debug 2 sets of code, instead of working from a good set to get my "bad" set to work correctly. 1) I don't understand the first question "does your RS422 is voltage interface to RS232?" What is "is voltage"? What is an "is voltage interface"? I apologize for my ignorance about this. I have a "true" RS422 port, +/- 5 volt differential if that is what you mean. There is no cross talk between the RS232 and RS422 that I can detect. I know that the RS422 port works, from the command line I have copied a file to that tty device and see voltage changes on my scope on the transmit+ and transmit- pins. 2) No USB dongles are involved in the "badness". That said, as a test, I have run the target java code on a laptop with a USB to serial dongle and a RS232 to RS422 converter hooked to my RS422 source and the serial communications is great. I know that my messaging code is parsing the messages and that the RxTx RS232 code is getting the correct interrupts for the raw data to build the messages up from the raw data. 3) See 2). When I enumerate the ports on my Linux machine, the RS422 port shows up as a serial port. portList = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier foundPortId = null; while (portList.hasMoreElements()) { portId = (gnu.io.CommPortIdentifier) portList.nextElement(); int portType = portId.getPortType(); System.out.println("Found port " + portId.getName()); System.out.println(" of port type " + portId.getPortType()); if (portType == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { portFound = true; foundPortId = portId; } } } I hope this is the information that you requested. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:40 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Thu Jun 24 16:25:11 2010 From: jredman at ergotech.com (Jim Redman) Date: Thu, 24 Jun 2010 16:25:11 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C23DB47.5070308@ergotech.com> RS485 has a 2-wire, half-duplex mode. In this case you need a mechanism to switch sender and receiver. In many cases, the RS485 port will do this for you. Most RS232<->RS485 converters will also manage the switching in a way that is totally transparent to you. In principle, if you don't have a port that handles switching automatically for you, you could control this switching in software. Realistically, unless you have a long delay between sending and reply generation, say 100ms or more, it would be difficult. With most system, the response comes back very quickly and user level code will be too slow to manage that. I think that RS422 is always 4-wire. From the software standpoint, it, and 4-wire RS422 (and current loop and ...) all look the same. There are some electrical issues with RS422 and RS485 particularly termination. I haven't hooked up 485 or 422 in a while so I don't remember all the details, but if you get it wrong it probably won't work. Jim On 06/24/2010 12:39 PM, Mariusz Dec wrote: > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, > I have a 232 port and everything is wonderful. I set the 422 port > up similarly and see no events firing (except output buffer empty). > I set up a scope on the connector and copy a file to the port > (/dev/ttyS1 in my case) and see output. I do the same through RxTx > and see nothing. If this is a setup problem, I am confused as I set > the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so > that I can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From mariusz.dec at gmail.com Fri Jun 25 01:52:48 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 25 Jun 2010 09:52:48 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, now you are sleeping and I have the next day :) So - "voltage interface" means that you have RS232 interface and voltage level converter to use it as RS422. In such case proper work of the RS232 determines proper work of the RS422 (if hw works). In case you make tests on physically different controllers, there may be a lot of traps more, especially now, when we have milions of USB/RS232 dongles vendors and milions of not-properly-working VCP-drivers. Your sentence: "dongle and a RS232 to RS422 converter hooked to" says that you have one RS232 controller and you are using "voltage interface" named >converter< to connect to external RS422 source. It means that only problem is somewhere on the physical part of the interface. If you are seeing signals on the scope, means that you may send dat ok. if you have checked that your USB-serial dongle works good with events, look for the hw mistakes (wiring etc). If you haven't yet checked if your USB-serial dongle works good with events read this: http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html AND always remember that USB-serial dongle isn't serial COM port, this is VIRTUAL Com Port. And this may make a big difference... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t function. > I am then trying to debug 2 sets of code, instead of working from a good set > to get my ?bad? set to work correctly. > > > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on the > transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is parsing > the messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up as > a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:40 PM > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't > the same ? > > Regards > Mariusz > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Fri Jun 25 01:54:39 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 25 Jun 2010 08:54:39 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: <4C23DB47.5070308@ergotech.com> References: <4C23DB47.5070308@ergotech.com> Message-ID: I'm happily using RXTX to communicate with RS422 devices in 4-wire mode using KK-Systems K2 RS232-RS422/RS485 converters (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). Running at 115200 baud -- no issues at all. Regards, Michael Erskine. From jredman at ergotech.com Fri Jun 25 11:29:10 2010 From: jredman at ergotech.com (Jim Redman) Date: Fri, 25 Jun 2010 11:29:10 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <4C23DB47.5070308@ergotech.com> Message-ID: <4C24E766.50102@ergotech.com> Note that the K2 doesn't do automatic switching for RS485, the K2-ADE does. For true RS422 this is irrelevant. We've used a bunch of converters, including some USB versions, some from B&B (http://www.bb-elec.com/) and some (a lot?) of the non-name, low cost RS232-RS485 converters that are out there. There really is no difference as far as the software is concerned. The cabling and termination of 485/422 do tend to be more problematic, and it's likely that the problem lies there rather than anywhere else. Jim On 06/25/2010 01:54 AM, Michael Erskine wrote: > I'm happily using RXTX to communicate with RS422 devices in 4-wire > mode using KK-Systems K2 RS232-RS422/RS485 converters > (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). > Running at 115200 baud -- no issues at all. > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From robohobby at gmail.com Sun Jun 27 07:41:33 2010 From: robohobby at gmail.com (Oleg Lyubchenko) Date: Sun, 27 Jun 2010 17:41:33 +0400 Subject: [Rxtx] Is it possible to receive data from serial port, using RXTX under Linux? Message-ID: Hi, I am trying to use RxTx for a simple project. Small board ETX should communicate with several devices, using serial ports. The application should work under Linux. Java is my favorite language and that was the reason, why RXTX was selected for the task. Under Windows all was OK. But under Linux I see strange thing - It is possible to send data to the port, but it is impossible to read data from port under Linux. Lock files are OK - this part work as it should. User (the user is 'root') has permissions to read-write to port (to device). Kermit and minicom works fine with the modem. The application can send data, but can not read data. As a test example I use standard example class - TwoWaySerialComm.java . I tried both versions of this file - one version without Events and version with Events. I see the same picture with Puppy Linux, with Ubuntu 9.10, OpenSuSE 11. As a hardware I use ETX board and notebook Samsung R40. Both platforms shows the same result - can write to port, can not read from port. What I mean by "send and receive data": I do very simple test - after connection to the device I type "atz" and waiting for the answer from the modem. Normal answer should be "OK". Under Windows, using "TwoWaySerialComm" I see : ATZ ATZ OK Under Linux I see only ATZ ATZ (No normal answer 'OK') Any ideas? PS: If you want to see the code, you can download the code of the project from http://www.robohobby.com/downloads/JavaRxTx.zip There is nothing special there - just project for Netbeans with code of two standard examples. to run it under Windows, use JavaRxTx\r.bat for Linux, use JavaRxTx\sh r.sh Sincerely, Oleg -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at iDIAcomputing.com Sun Jun 27 08:16:25 2010 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 27 Jun 2010 10:16:25 -0400 Subject: [Rxtx] Is it possible to receive data from serial port, using RXTX under Linux? In-Reply-To: References: Message-ID: <4C275D39.3060005@iDIAcomputing.com> Oleg On 6/27/10 9:41 AM, Oleg Lyubchenko wrote: > Under Windows, using "TwoWaySerialComm" I see : > ATZ > ATZ > OK > > Under Linux > I see only > ATZ > ATZ > > (No normal answer 'OK') > > Any ideas? > > PS: If you want to see the code, you can download the code of the > project from > http://www.robohobby.com/downloads/JavaRxTx.zip > There is nothing special there - just project for Netbeans with code of > two standard examples. > > to run it under Windows, use > JavaRxTx\r.bat > for Linux, use JavaRxTx\sh r.sh Oleg, I've not looked at your code, but are you sending both a carriage return and a linefeed to the modem? Windows will generally send both for a \n but Linux will generally only send a linefeed. You may need to use \r\n to get both. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From djjames at drs-ssi.com Mon Jun 28 07:40:32 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Mon, 28 Jun 2010 08:40:32 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: All, I have a box that has RS422 native, the sender of some data. I have another box that has RS422 native. My software runs on this machine. This is where my problem lies. I think I confused the issue with my statement about the 422/232 converter. I have the converter in my test setup to make certain that the sender was sending what I expected, hooked to a laptop with hyperterm. The production setup will have no converters. It cannot have a converter. I have another box on which I have to communicate via RS232. I have that communications up and running. I get the correct information out of my RS232 link. +------+ RS422 +----+ RS232 +-------+ |Sender|-------| Me |-------|Another| +------+ +----+ | Sender| +-------+ On the scope, I have verified that the RS422 sender is setting the transmit lines correctly. I cannot get my side of the RS422 communications to work. I have set my RS422 configuration to be similar to the RS232 that does work. The only event that I am getting is output buffer empty, even though I have turned off that notification (422port.notifyOnOutputEmpty(false);). I have 422port.notifyOnDataAvilable(true), yet I never get that event. It doesn't seem that I have things setup correctly. I have configured the RS422 port per my interface spec with the RS422 sender, yet I don't get any data (no data available events!). If I can't get this to work, I will be writing my own (which isn't a nice thought). From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Friday, June 25, 2010 2:53 AM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, now you are sleeping and I have the next day :) So - "voltage interface" means that you have RS232 interface and voltage level converter to use it as RS422. In such case proper work of the RS232 determines proper work of the RS422 (if hw works). In case you make tests on physically different controllers, there may be a lot of traps more, especially now, when we have milions of USB/RS232 dongles vendors and milions of not-properly-working VCP-drivers. Your sentence: "dongle and a RS232 to RS422 converter hooked to" says that you have one RS232 controller and you are using "voltage interface" named >converter< to connect to external RS422 source. It means that only problem is somewhere on the physical part of the interface. If you are seeing signals on the scope, means that you may send dat ok. if you have checked that your USB-serial dongle works good with events, look for the hw mistakes (wiring etc). If you haven't yet checked if your USB-serial dongle works good with events read this: http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html AND always remember that USB-serial dongle isn't serial COM port, this is VIRTUAL Com Port. And this may make a big difference... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I agree with the RS422/RS485/RS232 control side being the same. Everything I have read says that this should be so. I did notice that there is a RS485 implementation within RxTx that RS485Port.java states is "Non functional". I was thinking that I could/should use the RS485 code as a basis for the RS422 code, if necessary. But this seems a rash course of action if it doesn't function. I am then trying to debug 2 sets of code, instead of working from a good set to get my "bad" set to work correctly. 1) I don't understand the first question "does your RS422 is voltage interface to RS232?" What is "is voltage"? What is an "is voltage interface"? I apologize for my ignorance about this. I have a "true" RS422 port, +/- 5 volt differential if that is what you mean. There is no cross talk between the RS232 and RS422 that I can detect. I know that the RS422 port works, from the command line I have copied a file to that tty device and see voltage changes on my scope on the transmit+ and transmit- pins. 2) No USB dongles are involved in the "badness". That said, as a test, I have run the target java code on a laptop with a USB to serial dongle and a RS232 to RS422 converter hooked to my RS422 source and the serial communications is great. I know that my messaging code is parsing the messages and that the RxTx RS232 code is getting the correct interrupts for the raw data to build the messages up from the raw data. 3) See 2). When I enumerate the ports on my Linux machine, the RS422 port shows up as a serial port. portList = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier foundPortId = null; while (portList.hasMoreElements()) { portId = (gnu.io.CommPortIdentifier) portList.nextElement(); int portType = portId.getPortType(); System.out.println("Found port " + portId.getName()); System.out.println(" of port type " + portId.getPortType()); if (portType == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { portFound = true; foundPortId = portId; } } } I hope this is the information that you requested. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:40 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Jun 28 08:18:08 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 28 Jun 2010 17:18:08 +0300 Subject: [Rxtx] Port to RS422? In-Reply-To: Message-ID: > If I can?t get this to work, I will be writing my own (which isn?t a nice > thought). As stated, from the software point of view RSxxx are identical (or if there is a critical difference lurking somewhere in the details, you are screwed), so I would think that if you roll your own you will run into a similar problem that you are having with rxtx, thus is makes sense to figure out first *what* is the problem here, and then see if you need to write your own. Just my 2 snt, but I've been there, done that. br Kusti From jredman at ergotech.com Mon Jun 28 12:32:38 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 28 Jun 2010 12:32:38 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C28EAC6.8030908@ergotech.com> RS422 is multi-drop. If you just want to monitor what is going on (for debugging or other reasons) connect the two native RS422 systems together (if you can test that these are working at this point so much the better) then add the RS422 converter to the same lines - no need for a pass through. So you'll have: | RS422 |-------------------| RS422 | | | [ RS422 Converter ] The converter will see all traffic and can talk on the line (but that might confuse the other two components. Jim On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From jredman at ergotech.com Mon Jun 28 12:43:57 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 28 Jun 2010 12:43:57 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C28ED6D.2040807@ergotech.com> Just out of interest, what's the make/model of RS422 converter you're using? On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From andy at g0poy.com Mon Jun 28 15:12:00 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 28 Jun 2010 22:12:00 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <20100628221200.6ca3052d@workstation.site> Try TeraTerm rather than Hyperterm just in case that is the problem. http://www.ayera.com/teraterm/ I have known Hyperterm to do all sorts of things you don't tell it. (We gave up asking customers to use it) Sometimes it would receive OK, other times not. We never found out exactly what upset it. Generally we would be using it at 9600 8N1 so nothing special at all. After switching to TeraTerm we have no more problems. Andy On Mon, 28 Jun 2010 08:40:32 -0500 "James, David (DJ) (SA-1)" wrote: > All, > > > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > > > > > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > > > I cannot get my side of the RS422 communications to work. I have set > my RS422 configuration to be similar to the RS232 that does work. The > only event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn't seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don't get > any data (no data available events!). > > > > If I can't get this to work, I will be writing my own (which isn't a > nice thought). > > > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Friday, June 25, 2010 2:53 AM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and > voltage level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is "Non functional". I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn't > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my "bad" set to work correctly. > > > > 1) I don't understand the first question "does your RS422 is > voltage interface to RS232?" What is "is voltage"? What is an "is > voltage interface"? I apologize for my ignorance about this. > > > > I have a "true" RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the "badness". That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is > parsing the messages and that the RxTx RS232 code is getting the correct > interrupts for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:40 PM > > > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. > If this is a setup problem, I am confused as I set the two ports up > similarly. > > > > Thanks, > > DJ > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:18 PM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > From djjames at drs-ssi.com Mon Jun 28 15:28:24 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Mon, 28 Jun 2010 16:28:24 -0500 Subject: [Rxtx] RS422 converter model and (maybe) resolution. In-Reply-To: References: Message-ID: B&B Electronics 422PP9R. Things work great with it. It now appears to be the box. We were able to get another one in for testing and BlockBox is getting events as it should. He suggestion that it might be hardware was spot on. But (of course), you want to make certain that your stuff is working correctly before you accuse the other side of any wrong doing. Thanks for all the advice! DJ -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Monday, June 28, 2010 3:26 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 34, Issue 11 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. Re: Port to RS422? (Kustaa Nyholm) 2. Re: Port to RS422? (Jim Redman) 3. Re: Port to RS422? (Jim Redman) 4. Re: Port to RS422? (Andy Eskelson) ---------------------------------------------------------------------- Message: 1 Date: Mon, 28 Jun 2010 17:18:08 +0300 From: Kustaa Nyholm To: "rxtx at qbang.org" Subject: Re: [Rxtx] Port to RS422? Message-ID: Content-Type: text/plain; charset="iso-8859-1" > If I can?t get this to work, I will be writing my own (which isn?t a nice > thought). As stated, from the software point of view RSxxx are identical (or if there is a critical difference lurking somewhere in the details, you are screwed), so I would think that if you roll your own you will run into a similar problem that you are having with rxtx, thus is makes sense to figure out first *what* is the problem here, and then see if you need to write your own. Just my 2 snt, but I've been there, done that. br Kusti ------------------------------ Message: 2 Date: Mon, 28 Jun 2010 12:32:38 -0600 From: Jim Redman To: RXTX Developers and Users Subject: Re: [Rxtx] Port to RS422? Message-ID: <4C28EAC6.8030908 at ergotech.com> Content-Type: text/plain; charset=windows-1252; format=flowed RS422 is multi-drop. If you just want to monitor what is going on (for debugging or other reasons) connect the two native RS422 systems together (if you can test that these are working at this point so much the better) then add the RS422 converter to the same lines - no need for a pass through. So you'll have: | RS422 |-------------------| RS422 | | | [ RS422 Converter ] The converter will see all traffic and can talk on the line (but that might confuse the other two components. Jim On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com ------------------------------ Message: 3 Date: Mon, 28 Jun 2010 12:43:57 -0600 From: Jim Redman Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Message-ID: <4C28ED6D.2040807 at ergotech.com> Content-Type: text/plain; charset=windows-1252; format=flowed Just out of interest, what's the make/model of RS422 converter you're using? On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com ------------------------------ Message: 4 Date: Mon, 28 Jun 2010 22:12:00 +0100 From: Andy Eskelson To: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Message-ID: <20100628221200.6ca3052d at workstation.site> Content-Type: text/plain; charset=US-ASCII Try TeraTerm rather than Hyperterm just in case that is the problem. http://www.ayera.com/teraterm/ I have known Hyperterm to do all sorts of things you don't tell it. (We gave up asking customers to use it) Sometimes it would receive OK, other times not. We never found out exactly what upset it. Generally we would be using it at 9600 8N1 so nothing special at all. After switching to TeraTerm we have no more problems. Andy On Mon, 28 Jun 2010 08:40:32 -0500 "James, David (DJ) (SA-1)" wrote: > All, > > > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > > > > > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > > > I cannot get my side of the RS422 communications to work. I have set > my RS422 configuration to be similar to the RS232 that does work. The > only event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn't seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don't get > any data (no data available events!). > > > > If I can't get this to work, I will be writing my own (which isn't a > nice thought). > > > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Friday, June 25, 2010 2:53 AM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and > voltage level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is "Non functional". I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn't > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my "bad" set to work correctly. > > > > 1) I don't understand the first question "does your RS422 is > voltage interface to RS232?" What is "is voltage"? What is an "is > voltage interface"? I apologize for my ignorance about this. > > > > I have a "true" RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the "badness". That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is > parsing the messages and that the RxTx RS232 code is getting the correct > interrupts for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:40 PM > > > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. > If this is a setup problem, I am confused as I set the two ports up > similarly. > > > > Thanks, > > DJ > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:18 PM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > 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 End of Rxtx Digest, Vol 34, Issue 11 ************************************ From msemtd at googlemail.com Tue Jun 29 04:05:10 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 29 Jun 2010 11:05:10 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: <20100628221200.6ca3052d@workstation.site> References: <20100628221200.6ca3052d@workstation.site> Message-ID: On 28 June 2010 22:12, Andy Eskelson wrote: > Try TeraTerm rather than Hyperterm just in case that is the problem. > http://www.ayera.com/teraterm/ I recommend RealTerm over teraterm pro (proper FOSS licence, you get the source code, actively maintained, etc.): http://realterm.sourceforge.net/ Regards, Michael Erskine. From mariusz.dec at gmail.com Tue Jun 29 04:37:25 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 29 Jun 2010 12:37:25 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <20100628221200.6ca3052d@workstation.site> Message-ID: Hi, a bit from my experience :). I am using my own terminals only. Why? Because good transmission practice says that in data packet should be a header, trailer, checksum, block length etc. My terminals (software like Hyperterm) for each project have a simple current protocols parsers and shows important data in clear form. Additionally I can see whole time of the developing that second side of the transmission path works good as well (for example - good checksum arrives). Currently I am receiving /sendign quite large packets - about 50 bytes - how to look inside without tools? This is easy to write ad-hoc specialized terminal and this helps a lot :). Regards Mariusz 2010/6/29 Michael Erskine > On 28 June 2010 22:12, Andy Eskelson wrote: > > Try TeraTerm rather than Hyperterm just in case that is the problem. > > http://www.ayera.com/teraterm/ > > I recommend RealTerm over teraterm pro (proper FOSS licence, you get > the source code, actively maintained, etc.): > http://realterm.sourceforge.net/ > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Tue Jun 29 08:23:24 2010 From: jredman at ergotech.com (Jim Redman) Date: Tue, 29 Jun 2010 08:23:24 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <20100628221200.6ca3052d@workstation.site> Message-ID: <4C2A01DC.50200@ergotech.com> If you're on Windows and just trying to snoop the communications, then the Sysinternals "PortMon" can be useful: http://technet.microsoft.com/en-us/sysinternals/bb795533.aspx It looks as though RealTerm might have a similar feature. Jim On 06/29/2010 04:37 AM, Mariusz Dec wrote: > Hi, > a bit from my experience :). > > I am using my own terminals only. > Why? > Because good transmission practice says that in data packet should be a > header, trailer, checksum, block length etc. > My terminals (software like Hyperterm) for each project have a simple > current protocols parsers and shows important data in clear form. > Additionally I can see whole time of the developing that second side of > the transmission path works good as well (for example - good checksum > arrives). > Currently I am receiving /sendign quite large packets - about 50 bytes - > how to look inside without tools? > > This is easy to write ad-hoc specialized terminal and this helps a lot :). > > Regards > Mariusz > > > > 2010/6/29 Michael Erskine > > > On 28 June 2010 22:12, Andy Eskelson > wrote: > > Try TeraTerm rather than Hyperterm just in case that is the problem. > > http://www.ayera.com/teraterm/ > > I recommend RealTerm over teraterm pro (proper FOSS licence, you get > the source code, actively maintained, etc.): > http://realterm.sourceforge.net/ > > Regards, > Michael Erskine. > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From mariusz.dec at gmail.com Tue Jun 29 09:13:32 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Tue, 29 Jun 2010 17:13:32 +0200 Subject: [Rxtx] Port to RS422? References: <20100628221200.6ca3052d@workstation.site> <4C2A01DC.50200@ergotech.com> Message-ID: <260B5D1534CF44FF92AC19D9B016F177@mdam2> Hi, sysinternals has a lot of very usefull tools :). But in my projects binary data isn't enough when I receive some analog data from DAC's. This is voltage but as representation of temperature, pressure, voltage.... Easiest way is to do own terminal with simple parser. Now in the era of the USB/RS232 dongles another usefull tool is "just connected COM port finder"... I did it and work is comfortable - no more system crashes when disconecting USB while terminal is working. The most difficult was the first step after fight with Hyperterm few years ago... :) Regards :) Mariusz ----- Original Message ----- From: "Jim Redman" Cc: Sent: Tuesday, June 29, 2010 4:23 PM Subject: Re: [Rxtx] Port to RS422? > If you're on Windows and just trying to snoop the communications, then > the Sysinternals "PortMon" can be useful: > > http://technet.microsoft.com/en-us/sysinternals/bb795533.aspx > > It looks as though RealTerm might have a similar feature. > > Jim > > On 06/29/2010 04:37 AM, Mariusz Dec wrote: >> Hi, >> a bit from my experience :). >> >> I am using my own terminals only. >> Why? >> Because good transmission practice says that in data packet should be a >> header, trailer, checksum, block length etc. >> My terminals (software like Hyperterm) for each project have a simple >> current protocols parsers and shows important data in clear form. >> Additionally I can see whole time of the developing that second side of >> the transmission path works good as well (for example - good checksum >> arrives). >> Currently I am receiving /sendign quite large packets - about 50 bytes - >> how to look inside without tools? >> >> This is easy to write ad-hoc specialized terminal and this helps a lot :). >> >> Regards >> Mariusz >> >> >> >> 2010/6/29 Michael Erskine > > >> >> On 28 June 2010 22:12, Andy Eskelson > > wrote: >> > Try TeraTerm rather than Hyperterm just in case that is the problem. >> > http://www.ayera.com/teraterm/ >> >> I recommend RealTerm over teraterm pro (proper FOSS licence, you get >> the source code, actively maintained, etc.): >> http://realterm.sourceforge.net/ >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> 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 > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From andrea.antonello at gmail.com Tue Jun 29 14:39:49 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Tue, 29 Jun 2010 22:39:49 +0200 Subject: [Rxtx] wrapping rxtx in eclipse Message-ID: Hi developers, I am currently using rxtx in an eclipse based GIS project to connect to GPS via bluetooth. I found the http://rxtx.qbang.org/wiki/index.php/Wrapping_RXTX_in_an_Eclipse_Plugin page a great start to maintain platform "independency". We are currently working on eclipse 3.6 and created the rxtx plugins as they suggest to do them now using plugins and fragments. Currently the namespace of the plugin is ours with authors rxtx.org. I was thinking it probably would make more sense to create them with the rxtx namespace and make them downloadable here? So finally the question: - is it ok if I update the above wiki page with eclipse 3.6 instructions? - would there be interst for me maintaining the eclipse plugins for rxtx? - is it ok to add my project to the projects using rxtx? That's all, best regards, Andrea From karl.weber99 at gmx.net Wed Jun 30 03:17:26 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 30 Jun 2010 11:17:26 +0200 Subject: [Rxtx] wrapping rxtx in eclipse In-Reply-To: References: Message-ID: <201006301117.26265.karl.weber99@gmx.net> Am Dienstag, 29. Juni 2010 22:39 schrieb andrea antonello: > Hi developers, > I am currently using rxtx in an eclipse based GIS project to connect > to GPS via bluetooth. > I found the > http://rxtx.qbang.org/wiki/index.php/Wrapping_RXTX_in_an_Eclipse_Plugin > page a great start to maintain platform "independency". > > We are currently working on eclipse 3.6 and created the rxtx plugins > as they suggest to do them now using plugins and fragments. > Currently the namespace of the plugin is ours with authors rxtx.org. I > was thinking it probably would make more sense to create them with the > rxtx namespace and make them downloadable here? > So finally the question: > - is it ok if I update the above wiki page with eclipse 3.6 instructions? > - would there be interst for me maintaining the eclipse plugins for rxtx? > - is it ok to add my project to the projects using rxtx? > I am no OSGi expert, but if you think about maintaining an eclipse-plugin for rxtx, I would suggest a better solution, which should work, as far as I understand OSGi: (1) Create an OSGi-bundle. What I mean here is, that one should not use any eclipse / equinox specific stuff, so that this bundle can be used with other OSGi-frameworks as well. (2) Do not create a wrapper. If only java-classes where involved, the difference between an OSGi-Bundle and an ordinary jar-file was only some entries in the MANIFEST-header. So, instead of heaving a jar within a jar, I would prefer to have only one jar that is an OSGi-Bundle. Such OSGi-Bundle can also be used outside of any OSGi-framework, as ordinary jar-file. That rxtx involves c-libraries should not make much difference. In addition to the java-classes the (single) jar should also contain the libs. It would also be nice, to enhance the rxtx build-service, such that it can create such OSGi-bundles from the sources. /Karl P.S. I am currently also using a wrapper plug-in, but I am not happy with this solution... From andrea.antonello at gmail.com Wed Jun 30 04:07:24 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Wed, 30 Jun 2010 12:07:24 +0200 Subject: [Rxtx] wrapping rxtx in eclipse In-Reply-To: <201006301117.26265.karl.weber99@gmx.net> References: <201006301117.26265.karl.weber99@gmx.net> Message-ID: Hi Karl, I think your suggestions are good. The problem is that I am also no Osgi specialist. I can ensure a continuity in maintainment and bugfixes only by proposing something I would do anyways, which is keeping up the plugins and fragments for my project. For something something different I am afraid that after few time it would get of low priority in my list of job tasks and I prefer to not take that path. Andrea On Wed, Jun 30, 2010 at 11:17 AM, Karl Weber wrote: > Am Dienstag, 29. Juni 2010 22:39 schrieb andrea antonello: >> Hi developers, >> I am currently using rxtx in an eclipse based GIS project to connect >> to GPS via bluetooth. >> I found the >> http://rxtx.qbang.org/wiki/index.php/Wrapping_RXTX_in_an_Eclipse_Plugin >> page a great start to maintain platform "independency". >> >> We are currently working on eclipse 3.6 and created the rxtx plugins >> as they suggest to do them now using plugins and fragments. >> Currently the namespace of the plugin is ours with authors rxtx.org. I >> was thinking it probably would make more sense to create them with the >> rxtx namespace and make them downloadable here? >> So finally the question: >> - is it ok if I update the above wiki page with eclipse 3.6 instructions? >> - would there be interst for me maintaining the eclipse plugins for rxtx? >> - is it ok to add my project to the projects using rxtx? >> > > I am no OSGi expert, but if you think about maintaining an eclipse-plugin for > rxtx, I would suggest a better solution, which should work, as far as I > understand OSGi: > > (1) Create an OSGi-bundle. What I mean here is, that one should not use any > eclipse / equinox specific stuff, so that this bundle can be used with other > OSGi-frameworks as well. > > (2) Do not create a wrapper. If only java-classes where involved, the > difference between an OSGi-Bundle and an ordinary jar-file was only some > entries in the MANIFEST-header. So, instead of heaving a jar within a jar, I > would prefer to have only one jar that is an OSGi-Bundle. Such OSGi-Bundle > can also be used outside of any OSGi-framework, as ordinary jar-file. > > That rxtx involves c-libraries should not make much difference. In addition to > the java-classes the (single) jar should also contain the libs. > > It would also be nice, to enhance the rxtx build-service, such that it can > create such OSGi-bundles from the sources. > > /Karl > > > P.S. I am currently also using a wrapper plug-in, but I am not happy with this > solution... > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From leo.guimaraes at gmail.com Fri Jun 18 13:29:14 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Fri, 18 Jun 2010 15:29:14 -0400 Subject: [Rxtx] Virtual Port with RXTX Message-ID: Hello everybody, Please, im crazy trying to solve this problem: I created a virtual port in my server to receive data over the ethernet from a serial port in the client machine. Im using socat for that: In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: 192.168.102.41:54321 its working fine for me, accessing the virtual port via CuteCom or any terminal. But i can't access this port via RXTX. The getPortIdentifiers() method returns only the /dev/ttyS0 port. Please guys, could you help me about that? Thank you very much! Leandro Guimar?es -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Fri Jun 18 23:43:50 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 19 Jun 2010 07:43:50 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: Hi, In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: > 192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or any > terminal. But i can't access this port via RXTX. The getPortIdentifiers() > method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock Try to change name of the virtual port. I suppose you are using Linux, so: In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid prefixes for the Linux com ports. Add your prefix there or change your VCP name to match to any predefined prefix there. Regards Mariusz > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Sat Jun 19 08:03:06 2010 From: jredman at ergotech.com (Jim Redman) Date: Sat, 19 Jun 2010 08:03:06 -0600 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: <4C1CCE1A.90201@ergotech.com> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports so: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 or whatever you need for the virtual port. The ports will enumerate in the order give (I don't know whether this is a guaranteed behavior or just the way it happens to be). Jim On 06/18/2010 11:43 PM, Mariusz Dec wrote: > Hi, > > In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > tcp:192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or > any terminal. But i can't access this port via RXTX. The > getPortIdentifiers() method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork > file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > > Try to change name of the virtual port. > > I suppose you are using Linux, so: > > In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > prefixes for the Linux com ports. > Add your prefix there or change your VCP name to match to any predefined > prefix there. > > Regards > Mariusz > > > > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From leo.guimaraes at gmail.com Mon Jun 21 13:23:26 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 16:23:26 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: <4C1CCE1A.90201@ergotech.com> References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hello, Change my virtual port to ttySXX worked fine... But now, im having another problem... I dont know why, but the virtual port is never calling the SerialEvent in the SerialPortEventListenner... using the real Serial port, works fine. But it doesnt work with the virtual port... Somebody have an idea?? Pleasse! Thank you!! Leandro Guimar?es On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: > You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > so: > > > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > > or whatever you need for the virtual port. The ports will enumerate in the > order give (I don't know whether this is a guaranteed behavior or just the > way it happens to be). > > Jim > > > > > On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> Hi, >> >> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave >> tcp:192.168.102.41:54321 >> >> >> its working fine for me, accessing the virtual port via CuteCom or >> any terminal. But i can't access this port via RXTX. The >> getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >> Please guys, could you help me about that? >> >> >> In client machine: socat tcp-l:54321,reuseaddr,fork >> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >> Try to change name of the virtual port. >> >> I suppose you are using Linux, so: >> >> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> prefixes for the Linux com ports. >> Add your prefix there or change your VCP name to match to any predefined >> prefix there. >> >> Regards >> Mariusz >> >> >> >> Thank you very much! >> Leandro Guimar?es >> >> >> _______________________________________________ >> 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 >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > > _______________________________________________ > 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 Mon Jun 21 13:47:13 2010 From: george.dma at gmail.com (George H) Date: Mon, 21 Jun 2010 19:47:13 +0000 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, This might be because it is a virtual port. I used to do testing on usb/serial port and there were some "signals" it would not send me that a real serial port would. Try to see what signals your serial port sends you that the virtual port doesn't. I think there are some serial port sniffers out there where you can intercept the signals. Also would do good if you look at some technical tutorials on how serial port signals work. A good site which I read over many times to try to understand why things are the way they are is http://www.arcelect.com/rs232.htm I hope this gave you some ideas. Good luck -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Hello, > > ?? Change my virtual port to ttySXX worked fine... > > ?? But now, im having another problem... > > ? I dont know why, but the virtual port is never calling the SerialEvent in > the SerialPortEventListenner... using the real Serial port, works fine. But > it doesnt work with the virtual port... > > > ?? Somebody have an idea?? Pleasse! > > Thank you!! > Leandro Guimar?es > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports >> so: >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> the order give (I don't know whether this is a guaranteed behavior or just >> the way it happens to be). >> >> Jim >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >>> >>> Hi, >>> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >>> ? ?tcp:192.168.102.41:54321 >>> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >>> ? ?any terminal. But i can't access this port via RXTX. The >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >>> >>> ? ? ? Please guys, could you help me about that? >>> >>> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >>> >>> Try to change name of the virtual port. >>> >>> I suppose you are using Linux, so: >>> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >>> prefixes for the Linux com ports. >>> Add your prefix there or change your VCP name to match to any predefined >>> prefix there. >>> >>> Regards >>> Mariusz >>> >>> >>> >>> ? ?Thank you very much! >>> ? ?Leandro Guimar?es >>> >>> >>> ? ?_______________________________________________ >>> ? ?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 >> >> -- >> Jim Redman >> (505) 662 5156 x85 >> http://www.ergotech.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From leo.guimaraes at gmail.com Mon Jun 21 14:56:15 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 17:56:15 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Thanks George, Please, do you know what represents a "data available" in RXTX? Wich signal calls the Listener's Notify? Its the last thing that i need to do to finish my project here! Thank you very much! Leandro Guimar?es 2010/6/21 George H > Hi, > > This might be because it is a virtual port. > I used to do testing on usb/serial port and there were some "signals" > it would not send me that a real serial port would. > Try to see what signals your serial port sends you that the virtual > port doesn't. I think there are some serial port sniffers out there > where you can intercept the signals. Also would do good if you look at > some technical tutorials on how serial port signals work. > > A good site which I read over many times to try to understand why > things are the way they are is http://www.arcelect.com/rs232.htm > > I hope this gave you some ideas. > Good luck > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Hello, > > > > Change my virtual port to ttySXX worked fine... > > > > But now, im having another problem... > > > > I dont know why, but the virtual port is never calling the SerialEvent > in > > the SerialPortEventListenner... using the real Serial port, works fine. > But > > it doesnt work with the virtual port... > > > > > > Somebody have an idea?? Pleasse! > > > > Thank you!! > > Leandro Guimar?es > > > > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > wrote: > >> > >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > >> so: > >> > >> > >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> > >> or whatever you need for the virtual port. The ports will enumerate in > >> the order give (I don't know whether this is a guaranteed behavior or > just > >> the way it happens to be). > >> > >> Jim > >> > >> > >> > >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >>> > >>> Hi, > >>> > >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >>> tcp:192.168.102.41:54321 > >>> > >>> its working fine for me, accessing the virtual port via CuteCom or > >>> any terminal. But i can't access this port via RXTX. The > >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >>> > >>> Please guys, could you help me about that? > >>> > >>> > >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >>> > >>> Try to change name of the virtual port. > >>> > >>> I suppose you are using Linux, so: > >>> > >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >>> prefixes for the Linux com ports. > >>> Add your prefix there or change your VCP name to match to any > predefined > >>> prefix there. > >>> > >>> Regards > >>> Mariusz > >>> > >>> > >>> > >>> Thank you very much! > >>> Leandro Guimar?es > >>> > >>> > >>> _______________________________________________ > >>> 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 > >> > >> -- > >> Jim Redman > >> (505) 662 5156 x85 > >> http://www.ergotech.com > >> _______________________________________________ > >> 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 george.dma at gmail.com Mon Jun 21 22:51:50 2010 From: george.dma at gmail.com (George H) Date: Tue, 22 Jun 2010 07:51:50 +0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Did you read the site I posted? If you did you would have figured out which pin signal on the RS232 interface most likely triggers the data available event. It might be pin 2 and it might be pin 3, depends what kind of serial port you have and the cable. Plus i'm no expert on on RS-232 interfaces, I just know that if I have my hardware in front of me, and the source code of rxtx and a rs-232 specifications sheet then I can debug the problem and find out. This is what I believe you should do to get started to find out the "what, where and why" of your problem. -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Thanks George, > > ?? Please, do you know what represents a "data available" in RXTX? Wich > signal calls the Listener's Notify? > > ?? Its the last thing that i need to do to finish my project here! > > Thank you very much! > > Leandro Guimar?es > > > 2010/6/21 George H >> >> Hi, >> >> This might be because it is a virtual port. >> I used to do testing on usb/serial port and there were some "signals" >> it would not send me that a real serial port would. >> Try to see what signals your serial port sends you that the virtual >> port doesn't. I think there are some serial port sniffers out there >> where you can intercept the signals. Also would do good if you look at >> some technical tutorials on how serial port signals work. >> >> A good site which I read over many times to try to understand why >> things are the way they are is http://www.arcelect.com/rs232.htm >> >> I hope this gave you some ideas. >> Good luck >> -- >> George H >> george.dma at gmail.com >> >> >> >> 2010/6/21 Leandro Guimar?es : >> > Hello, >> > >> > ?? Change my virtual port to ttySXX worked fine... >> > >> > ?? But now, im having another problem... >> > >> > ? I dont know why, but the virtual port is never calling the SerialEvent >> > in >> > the SerialPortEventListenner... using the real Serial port, works fine. >> > But >> > it doesnt work with the virtual port... >> > >> > >> > ?? Somebody have an idea?? Pleasse! >> > >> > Thank you!! >> > Leandro Guimar?es >> > >> > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman >> > wrote: >> >> >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of >> >> ports >> >> so: >> >> >> >> >> >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> >> the order give (I don't know whether this is a guaranteed behavior or >> >> just >> >> the way it happens to be). >> >> >> >> Jim >> >> >> >> >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >> >>> >> >>> Hi, >> >>> >> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >> >>> ? ?tcp:192.168.102.41:54321 >> >>> >> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >> >>> ? ?any terminal. But i can't access this port via RXTX. The >> >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >>> >> >>> ? ? ? Please guys, could you help me about that? >> >>> >> >>> >> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >>> >> >>> Try to change name of the virtual port. >> >>> >> >>> I suppose you are using Linux, so: >> >>> >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> >>> prefixes for the Linux com ports. >> >>> Add your prefix there or change your VCP name to match to any >> >>> predefined >> >>> prefix there. >> >>> >> >>> Regards >> >>> Mariusz >> >>> >> >>> >> >>> >> >>> ? ?Thank you very much! >> >>> ? ?Leandro Guimar?es >> >>> >> >>> >> >>> ? ?_______________________________________________ >> >>> ? ?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 >> >> >> >> -- >> >> Jim Redman >> >> (505) 662 5156 x85 >> >> http://www.ergotech.com >> >> _______________________________________________ >> >> Rxtx mailing list >> >> Rxtx at qbang.org >> >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > >> > _______________________________________________ >> > Rxtx mailing list >> > Rxtx at qbang.org >> > http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > > > From mariusz.dec at gmail.com Tue Jun 22 05:32:01 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 22 Jun 2010 13:32:01 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, I am working with virtual ports only. Because of some problems with events I have changed whole idea. I did a thread in Java which is looking for port data in pool. If data comes in, I parse it and than generate an Java exception for the application. This works very good from several months and has an advantage more - is faster than events services. I have published many times an example code. Look for 2009'november thread "RXTX close() problem solved". In this example you can set Exception generation in read thread. There is a lot of "try-catch" loops which prevents system while you disconnect USB as well. For me works very good in Mac/Linux and Windows. Regards Mariusz 2010/6/22 George H > Did you read the site I posted? If you did you would have figured out > which pin signal on the RS232 interface most likely triggers the data > available event. > It might be pin 2 and it might be pin 3, depends what kind of serial > port you have and the cable. > > Plus i'm no expert on on RS-232 interfaces, I just know that if I have > my hardware in front of me, and the source code of rxtx and a rs-232 > specifications sheet then I can debug the problem and find out. This > is what I believe you should do to get started to find out the "what, > where and why" of your problem. > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Thanks George, > > > > Please, do you know what represents a "data available" in RXTX? Wich > > signal calls the Listener's Notify? > > > > Its the last thing that i need to do to finish my project here! > > > > Thank you very much! > > > > Leandro Guimar?es > > > > > > 2010/6/21 George H > >> > >> Hi, > >> > >> This might be because it is a virtual port. > >> I used to do testing on usb/serial port and there were some "signals" > >> it would not send me that a real serial port would. > >> Try to see what signals your serial port sends you that the virtual > >> port doesn't. I think there are some serial port sniffers out there > >> where you can intercept the signals. Also would do good if you look at > >> some technical tutorials on how serial port signals work. > >> > >> A good site which I read over many times to try to understand why > >> things are the way they are is http://www.arcelect.com/rs232.htm > >> > >> I hope this gave you some ideas. > >> Good luck > >> -- > >> George H > >> george.dma at gmail.com > >> > >> > >> > >> 2010/6/21 Leandro Guimar?es : > >> > Hello, > >> > > >> > Change my virtual port to ttySXX worked fine... > >> > > >> > But now, im having another problem... > >> > > >> > I dont know why, but the virtual port is never calling the > SerialEvent > >> > in > >> > the SerialPortEventListenner... using the real Serial port, works > fine. > >> > But > >> > it doesnt work with the virtual port... > >> > > >> > > >> > Somebody have an idea?? Pleasse! > >> > > >> > Thank you!! > >> > Leandro Guimar?es > >> > > >> > > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > >> > wrote: > >> >> > >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of > >> >> ports > >> >> so: > >> >> > >> >> > >> >> > >> >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> >> > >> >> or whatever you need for the virtual port. The ports will enumerate > in > >> >> the order give (I don't know whether this is a guaranteed behavior or > >> >> just > >> >> the way it happens to be). > >> >> > >> >> Jim > >> >> > >> >> > >> >> > >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> >>> > >> >>> Hi, > >> >>> > >> >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >> >>> tcp:192.168.102.41:54321 > >> >>> > >> >>> its working fine for me, accessing the virtual port via CuteCom > or > >> >>> any terminal. But i can't access this port via RXTX. The > >> >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >> >>> > >> >>> Please guys, could you help me about that? > >> >>> > >> >>> > >> >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >> >>> > >> >>> Try to change name of the virtual port. > >> >>> > >> >>> I suppose you are using Linux, so: > >> >>> > >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >> >>> prefixes for the Linux com ports. > >> >>> Add your prefix there or change your VCP name to match to any > >> >>> predefined > >> >>> prefix there. > >> >>> > >> >>> Regards > >> >>> Mariusz > >> >>> > >> >>> > >> >>> > >> >>> Thank you very much! > >> >>> Leandro Guimar?es > >> >>> > >> >>> > >> >>> _______________________________________________ > >> >>> 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 > >> >> > >> >> -- > >> >> Jim Redman > >> >> (505) 662 5156 x85 > >> >> http://www.ergotech.com > >> >> _______________________________________________ > >> >> 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 > >> > > >> > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Tue Jun 22 07:20:17 2010 From: showard314 at gmail.com (Scott Howard) Date: Tue, 22 Jun 2010 09:20:17 -0400 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails Message-ID: This is forwarded from: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472053 by Jan Niehusmann I tried putting this on the bug tracker but I couldn't get access In the static initializer of gnu.io.RXTXPort, an exception when initializing the static variable 'z' is silently discarded: try { z = new Zystem(); } catch ( Exception e ) {}; This leads to NullPointerExceptions later, which are difficult to debug as the original exception is lost. I did change the code to try { z = new Zystem(); } catch ( Exception e ) { throw new Error(e.toString()); }; for debugging. Probably a more specific exception would be more appropriate, but the point is that leaving z undefined without reporting an error makes debugging unnecessarily difficult. Thanks. From g3vbv at blueyonder.co.uk Tue Jun 22 19:20:11 2010 From: g3vbv at blueyonder.co.uk (Sid Boyce) Date: Wed, 23 Jun 2010 02:20:11 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar Message-ID: <4C21614B.3060504@blueyonder.co.uk> I am using openSUSE 11.3 RC1. "rfcomm -a" lists no devices From dmesg =========== [288811.093151] usb 2-4.4.2: new full speed USB device using ehci_hcd and address 16 [288811.207421] usb 2-4.4.2: New USB device found, idVendor=0403, idProduct=6001 [288811.207431] usb 2-4.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [288811.207438] usb 2-4.4.2: Product: FT232R USB UART [288811.207443] usb 2-4.4.2: Manufacturer: FTDI [288811.207447] usb 2-4.4.2: SerialNumber: A100efz7 [288811.210509] ftdi_sio 2-4.4.2:1.0: FTDI USB Serial Device converter detected [288811.210534] usb 2-4.4.2: Detected FT232RL [288811.210536] usb 2-4.4.2: Number of endpoints 2 [288811.210538] usb 2-4.4.2: Endpoint 1 MaxPacketSize 64 [288811.210540] usb 2-4.4.2: Endpoint 2 MaxPacketSize 64 [288811.210541] usb 2-4.4.2: Setting MaxPacketSize 64 [288811.210822] usb 2-4.4.2: FTDI USB Serial Device converter now attached to ttyUSB1 Package built and installed OK in /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/amd64, it also installed /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/RXTXcomm.jar slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar RXTXcomm.jar Failed to load Main-Class manifest attribute from RXTXcomm.jar # rpm -qa |grep java java-1_6_0-sun-1.6.0.u20-1.15.x86_64 gcc44-java-4.4.2_20100116-1.2.x86_64 netbeans-javaparser-6.8-1.1.noarch gcc45-java-4.5.0_20100604-1.1.x86_64 ant-javadoc-1.7.1-11.1.noarch javahelp2-2.0.05-6.28.noarch gcc43-java-4.3.4_20091019-2.25.x86_64 gcc-java-4.5-5.2.x86_64 java-ca-certificates-1-5.1.noarch java-1_6_0-sun-devel-1.6.0.u20-1.15.x86_64 lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> echo $JAVA_HOME /usr/lib64/jvm/java-1.6.0-sun-1.6.0 > l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/amd64/ total 6440 drwxr-xr-x 8 root root 4096 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ drwxr-xr-x 2 root root 23 2010-06-18 16:41 headless/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 jli/ -rw-r--r-- 1 root root 652 2010-04-12 22:00 jvm.cfg -rwxr-xr-x 1 root root 15836 2010-04-12 22:25 libattach.so* -rwxr-xr-x 1 root root 757091 2010-04-12 22:25 libawt.so* -rwxr-xr-x 1 root root 413267 2010-04-12 22:25 libcmm.so* -rwxr-xr-x 1 root root 217736 2010-04-12 22:25 libdcpr.so* -rwxr-xr-x 1 root root 120029 2010-04-12 22:30 libdeploy.so* -rwxr-xr-x 1 root root 21670 2010-04-12 22:25 libdt_socket.so* -rwxr-xr-x 1 root root 692649 2010-04-12 22:25 libfontmanager.so* -rwxr-xr-x 1 root root 237073 2010-04-12 22:25 libhprof.so* -rwxr-xr-x 1 root root 50085 2010-04-12 22:25 libinstrument.so* -rwxr-xr-x 1 root root 27244 2010-04-12 22:25 libioser12.so* -rwxr-xr-x 1 root root 46723 2010-04-12 22:25 libj2gss.so* -rwxr-xr-x 1 root root 14272 2010-04-12 22:25 libj2pcsc.so* -rwxr-xr-x 1 root root 78017 2010-04-12 22:25 libj2pkcs11.so* -rwxr-xr-x 1 root root 7980 2010-04-12 22:25 libjaas_unix.so* -rwxr-xr-x 1 root root 28919 2010-04-12 22:25 libjava_crw_demo.so* -rwxr-xr-x 1 root root 231135 2010-04-12 22:25 libjava.so* -rwxr-xr-x 1 root root 7099 2010-04-12 22:25 libjawt.so* -rwxr-xr-x 1 root root 293725 2010-04-12 22:25 libjdwp.so* -rwxr-xr-x 1 root root 224947 2010-04-12 22:25 libjpeg.so* -rwxr-xr-x 1 root root 10964 2010-04-12 22:25 libjsig.so* -rwxr-xr-x 1 root root 260521 2010-04-12 22:25 libjsound.so* -rwxr-xr-x 1 root root 37449 2010-04-12 22:25 libmanagement.so* -rwxr-xr-x 1 root root 734280 2010-04-12 22:25 libmlib_image.so* -rwxr-xr-x 1 root root 6667 2010-04-12 22:25 libnative_chmod_g.so* -rwxr-xr-x 1 root root 6571 2010-04-12 22:25 libnative_chmod.so* -rwxr-xr-x 1 root root 111945 2010-04-12 22:25 libnet.so* -rwxr-xr-x 1 root root 43716 2010-04-12 22:25 libnio.so* -rwxr-xr-x 1 root root 15651 2010-04-12 22:25 libnpt.so* -rwxr-xr-x 1 root root 6420 2010-04-12 22:25 librmi.so* -rwxr-xr-x 1 root root 77907 2010-06-18 16:56 librxtxI2C-2.2pre1.so* -rw-r--r-- 1 root root 97530 2010-06-18 16:56 librxtxI2C.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxI2C.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxI2C.so -> librxtxI2C-2.2pre1.so* -rwxr-xr-x 1 root root 55253 2010-06-18 16:56 librxtxParallel-2.2pre1.so* -rw-r--r-- 1 root root 66164 2010-06-18 16:56 librxtxParallel.a -rwxr-xr-x 1 root root 1035 2010-06-18 16:56 librxtxParallel.la* lrwxrwxrwx 1 root root 26 2010-06-18 16:56 librxtxParallel.so -> librxtxParallel-2.2pre1.so* -rwxr-xr-x 1 root root 79049 2010-06-18 16:56 librxtxRaw-2.2pre1.so* -rw-r--r-- 1 root root 100218 2010-06-18 16:56 librxtxRaw.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxRaw.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxRaw.so -> librxtxRaw-2.2pre1.so* -rwxr-xr-x 1 root root 78134 2010-06-18 16:56 librxtxRS485-2.2pre1.so* -rw-r--r-- 1 root root 98662 2010-06-18 16:56 librxtxRS485.a -rwxr-xr-x 1 root root 1014 2010-06-18 16:56 librxtxRS485.la* lrwxrwxrwx 1 root root 23 2010-06-18 16:56 librxtxRS485.so -> librxtxRS485-2.2pre1.so* -rwxr-xr-x 1 root root 192681 2010-06-18 16:56 librxtxSerial-2.2pre1.so* -rw-r--r-- 1 root root 267524 2010-06-18 16:56 librxtxSerial.a -rwxr-xr-x 1 root root 1021 2010-06-18 16:56 librxtxSerial.la* lrwxrwxrwx 1 root root 24 2010-06-18 16:56 librxtxSerial.so -> librxtxSerial-2.2pre1.so* -rwxr-xr-x 1 root root 48036 2010-04-12 22:25 libsaproc.so* -rwxr-xr-x 1 root root 294575 2010-04-12 22:25 libsplashscreen.so* -rwxr-xr-x 1 root root 134786 2010-04-12 22:25 libunpack.so* -rwxr-xr-x 1 root root 66292 2010-04-12 22:25 libverify.so* -rwxr-xr-x 1 root root 91191 2010-04-12 22:25 libzip.so* drwxr-xr-x 2 root root 23 2010-06-18 16:41 motif21/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 native_threads/ drwxr-xr-x 2 root root 56 2010-06-18 16:41 server/ -rw------- 1 root root 0 2010-06-18 16:53 stC2p3qT -rw------- 1 root root 0 2010-06-18 16:53 stJpl8lW -rw------- 1 root root 0 2010-06-18 16:53 stnb1qWY -rw------- 1 root root 0 2010-06-18 16:53 stYjTgRS -rw------- 1 root root 0 2010-06-18 16:53 stZA8aVV drwxr-xr-x 2 root root 23 2010-06-18 16:41 xawt/ lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/ total 1300 drwxr-xr-x 2 root root 125 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ -rw-r--r-- 1 root root 8239 2010-04-12 22:08 dnsns.jar -rw-r--r-- 1 root root 842216 2010-06-10 12:45 localedata.jar -rw-r--r-- 1 root root 429 2010-04-12 22:23 meta-index -rwxr-xr-x 1 root root 61389 2010-06-18 16:56 RXTXcomm.jar* -rw-r--r-- 1 root root 170239 2010-04-12 21:58 sunjce_provider.jar -rw-r--r-- 1 root root 230608 2010-04-12 22:08 sunpkcs11.jar Help appreciated. 73 ... Sid. -- Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support Specialist, Cricket Coach Microsoft Windows Free Zone - Linux used for all Computing Tasks From Kustaa.Nyholm at planmeca.com Tue Jun 22 23:38:46 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 08:38:46 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: Message-ID: > I did change the code to > try { > z = new Zystem(); > } catch ( Exception e ) { > throw new Error(e.toString()); > }; Is there a reason why this could/should not be: > try { > z = new Zystem(); > } catch ( Throwable e ) { > e.printStackTrace(System.err); > }; From msemtd at googlemail.com Wed Jun 23 02:14:25 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:14:25 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar In-Reply-To: <4C21614B.3060504@blueyonder.co.uk> References: <4C21614B.3060504@blueyonder.co.uk> Message-ID: On 23 June 2010 02:20, Sid Boyce wrote: > slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar > RXTXcomm.jar > Failed to load Main-Class manifest attribute from > RXTXcomm.jar > Help appreciated. > 73 ... Sid. Well Sid, it's pretty obvious to me: you're trying to launch a jar that doesn't contain a main(). What exactly are you trying to achieve by running "java -jar RXTXcomm.jar"? Regards, Michael Erskine. From msemtd at googlemail.com Wed Jun 23 02:17:11 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:17:11 +0100 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: On 23 June 2010 06:38, Kustaa Nyholm wrote: > >> I did change the code to >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >> ? ? ? ? ? ? ? ?}; > > Is there a reason why this could/should not be: > > >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >> ? ? ? ? ? ? ? ?}; Or even just let the exception bubble up and kill whatever thread caused the class to load :) I vote for the removal of Zystem BTW! Regards, Michael Erskine. From george.dma at gmail.com Wed Jun 23 02:34:07 2010 From: george.dma at gmail.com (George H) Date: Wed, 23 Jun 2010 11:34:07 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: -- George H george.dma at gmail.com On Wed, Jun 23, 2010 at 11:17 AM, Michael Erskine wrote: > On 23 June 2010 06:38, Kustaa Nyholm wrote: >> >>> I did change the code to >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >>> ? ? ? ? ? ? ? ?}; >> >> Is there a reason why this could/should not be: >> >> >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >>> ? ? ? ? ? ? ? ?}; > > Or even just let the exception bubble up and kill whatever thread > caused the class to load :) > > I vote for the removal of Zystem BTW! > > Regards, > Michael Erskine. I would prefer that an exception is thrown rather than the stack trace be printed. If anyone is using loggers then it would be useful to catch the exception and log it, rather than let it come out in the error stream where no one might look. From Steffen.DETTMER at ingenico.com Wed Jun 23 03:28:45 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 11:28:45 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: <20100623092844.GF20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 08:38 +0300: > > I did change the code to > > try { > > z = new Zystem(); > > } catch ( Exception e ) { > > throw new Error(e.toString()); > > }; > > Is there a reason why this could/should not be: > > > try { > > z = new Zystem(); > > } catch ( Throwable e ) { > > e.printStackTrace(System.err); > > }; Is this intentionally not throwing the exception? Well, then it still would be discarded (althrough not neccesarily silently :)). BTW, I don't think System.err is a good idea. It is `statically initialized'? I think then this means it is unclear who the caller is and who could catch this exception. Wouldn't it be better to store the exception in a member and throw it when needing Zystem (e.g. in new or open)? 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 Kustaa.Nyholm at planmeca.com Wed Jun 23 03:55:30 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 12:55:30 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: >> Is there a reason why this could/should not be: >> >>> try { >>> z = new Zystem(); >>> } catch ( Throwable e ) { >>> e.printStackTrace(System.err); >>> }; > > Is this intentionally not throwing the exception? Well, no, just a hasty reply from my part. > still would be discarded (althrough not neccesarily silently :)). > BTW, I don't think System.err is a good idea. > > It is `statically initialized'? I think then this means it is > unclear who the caller is and who could catch this exception. > Even so re-throwing the exception would make sense so that the application developer has a chance to handle this in whichever way they want. Of course logically this should not then print the stacktrace because that is the responsibility of the application developer. But so many do not handle these cases sensibly so from the application user point of view it is nice to have something on the console to aid in trouble shooting. Have not checked the context in which this happens so that might influence my opinion. > Wouldn't it be better to store the exception in a member and > throw it when needing Zystem (e.g. in new or open) I'm of the fail-fast school of thought so I think it should be reported and re-thrown as it happens, not later. br Kusti From pietro.galassi at gmail.com Wed Jun 23 05:59:29 2010 From: pietro.galassi at gmail.com (Pietro Galassi) Date: Wed, 23 Jun 2010 13:59:29 +0200 Subject: [Rxtx] Resource temporarily unavaible on writeByte() Message-ID: Hi, i have successfully installe RXTX 64bit version from UBUNTO repository. I wrote a simple test program and it shows i have 3 ports avaible on my system: /dev/ttyS1 - Serial /dev/ttyS0 - Serial /dev/lp0 - Parallel but as soon as i try to "writeByte" any data on the parallel port it always gives me: java.io.IOException: Resource temporarily unavaible on writeByte() My simple code is: ... outputStream = parallelPort.getOutputStream() ; System.out.println("Write..."); outputStream.write(88); outputStream.flush(); outputStream.close(); ... int mode = parallelPort.getMode(); gives always 0. Anyone can help pls ? Thanks a lot, Pietro Galassi -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Jun 23 10:35:37 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 18:35:37 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: <20100623163536.GI20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 12:55 +0300: > > Wouldn't it be better to store the exception in a member and > > throw it when needing Zystem (e.g. in new or open) > > I'm of the fail-fast school of thought so I think it should be > reported and re-thrown as it happens, not later. Ahh yes, I agree, in general it is much better to fail quick, loud and verbosely, right! However, if this is a static { } block, AFAIK it is not defined when it will be executed (Before application start? Or later, when loading the class later? Or when using it first time?). If the exception would be thrown before main() is called, I think it is difficult to catch it. I think some general global hook must be used to do so. Simpler to handle, if it is thrown when invocating some function, then it can be caught by try { } catch. (or am I wrong or outdated?) 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 rbreznak at neuronrobotics.com Wed Jun 23 11:46:21 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Wed, 23 Jun 2010 13:46:21 -0400 Subject: [Rxtx] Bundling native libraries Message-ID: Hello, I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. Has anyone had experience in doing this? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Wed Jun 23 18:26:17 2010 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 23 Jun 2010 17:26:17 -0700 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Whoops, forgot to copy this to the RXTX list ... ---------- Forwarded message ---------- From: Brian Schlining Date: Wed, Jun 23, 2010 at 11:11 Subject: Re: [Rxtx] Bundling native libraries To: "Breznak, Robert" Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a > one jar. Its to the point where I have an Ant script that pulls all of the > jars together, but I haven't been able to get the native libraries to work; > They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the > user to get and use. They don't need to worry about external dependencies > and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 24 00:37:35 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 24 Jun 2010 08:37:35 +0200 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Here is a snippet from my ant file. I actually unjar the rxtx jar file and add my own classes to it for Mac and WIndows. The snippet below is actually for Mac but just for your info I am using nsis and launch4j to create an exectuable for windows. I also copy the rxtx libs to the root folder of my application: On 24.06.2010, at 02:26, Brian Schlining wrote: > Whoops, forgot to copy this to the RXTX list ... > > ---------- Forwarded message ---------- > From: Brian Schlining > Date: Wed, Jun 23, 2010 at 11:11 > Subject: Re: [Rxtx] Bundling native libraries > To: "Breznak, Robert" > > > Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc > > On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 11:29:21 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 12:29:21 -0500 Subject: [Rxtx] Port to RS422? Message-ID: Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jun 24 12:18:10 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:18:10 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Thu Jun 24 12:22:15 2010 From: showard314 at gmail.com (Scott Howard) Date: Thu, 24 Jun 2010 14:22:15 -0400 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, On Thu, Jun 24, 2010 at 1:29 PM, James, David (DJ) (SA-1) wrote: > Has anyone tried porting RxTx to RS422? Don't know for sure but . . . > If not, where is all the C code for the other implementations so that I can > give it a shot? http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code There is a file called "PORTING" in the root of rxtx-devel Also refer to the (outdated) information on: http://users.frii.com/jarvi/rxtx/porting.html which has similar information to the PORTING file (trust the PORTING file in case of conflicts) I attached a copy of that file from the 2.2pre2 release to this email. Also, see the "toy box" section: http://rxtx.qbang.org/wiki/index.php/Download for compiled downloads on other platforms good luck. ~Scott -------------- next part -------------- A non-text attachment was scrubbed... Name: PORTING Type: application/octet-stream Size: 5017 bytes Desc: not available URL: From djjames at drs-ssi.com Thu Jun 24 12:22:52 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 13:22:52 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ 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 Jun 24 12:39:42 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:39:42 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 14:10:41 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 15:10:41 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I agree with the RS422/RS485/RS232 control side being the same. Everything I have read says that this should be so. I did notice that there is a RS485 implementation within RxTx that RS485Port.java states is "Non functional". I was thinking that I could/should use the RS485 code as a basis for the RS422 code, if necessary. But this seems a rash course of action if it doesn't function. I am then trying to debug 2 sets of code, instead of working from a good set to get my "bad" set to work correctly. 1) I don't understand the first question "does your RS422 is voltage interface to RS232?" What is "is voltage"? What is an "is voltage interface"? I apologize for my ignorance about this. I have a "true" RS422 port, +/- 5 volt differential if that is what you mean. There is no cross talk between the RS232 and RS422 that I can detect. I know that the RS422 port works, from the command line I have copied a file to that tty device and see voltage changes on my scope on the transmit+ and transmit- pins. 2) No USB dongles are involved in the "badness". That said, as a test, I have run the target java code on a laptop with a USB to serial dongle and a RS232 to RS422 converter hooked to my RS422 source and the serial communications is great. I know that my messaging code is parsing the messages and that the RxTx RS232 code is getting the correct interrupts for the raw data to build the messages up from the raw data. 3) See 2). When I enumerate the ports on my Linux machine, the RS422 port shows up as a serial port. portList = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier foundPortId = null; while (portList.hasMoreElements()) { portId = (gnu.io.CommPortIdentifier) portList.nextElement(); int portType = portId.getPortType(); System.out.println("Found port " + portId.getName()); System.out.println(" of port type " + portId.getPortType()); if (portType == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { portFound = true; foundPortId = portId; } } } I hope this is the information that you requested. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:40 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Thu Jun 24 16:25:11 2010 From: jredman at ergotech.com (Jim Redman) Date: Thu, 24 Jun 2010 16:25:11 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C23DB47.5070308@ergotech.com> RS485 has a 2-wire, half-duplex mode. In this case you need a mechanism to switch sender and receiver. In many cases, the RS485 port will do this for you. Most RS232<->RS485 converters will also manage the switching in a way that is totally transparent to you. In principle, if you don't have a port that handles switching automatically for you, you could control this switching in software. Realistically, unless you have a long delay between sending and reply generation, say 100ms or more, it would be difficult. With most system, the response comes back very quickly and user level code will be too slow to manage that. I think that RS422 is always 4-wire. From the software standpoint, it, and 4-wire RS422 (and current loop and ...) all look the same. There are some electrical issues with RS422 and RS485 particularly termination. I haven't hooked up 485 or 422 in a while so I don't remember all the details, but if you get it wrong it probably won't work. Jim On 06/24/2010 12:39 PM, Mariusz Dec wrote: > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, > I have a 232 port and everything is wonderful. I set the 422 port > up similarly and see no events firing (except output buffer empty). > I set up a scope on the connector and copy a file to the port > (/dev/ttyS1 in my case) and see output. I do the same through RxTx > and see nothing. If this is a setup problem, I am confused as I set > the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so > that I can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From mariusz.dec at gmail.com Fri Jun 25 01:52:48 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 25 Jun 2010 09:52:48 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, now you are sleeping and I have the next day :) So - "voltage interface" means that you have RS232 interface and voltage level converter to use it as RS422. In such case proper work of the RS232 determines proper work of the RS422 (if hw works). In case you make tests on physically different controllers, there may be a lot of traps more, especially now, when we have milions of USB/RS232 dongles vendors and milions of not-properly-working VCP-drivers. Your sentence: "dongle and a RS232 to RS422 converter hooked to" says that you have one RS232 controller and you are using "voltage interface" named >converter< to connect to external RS422 source. It means that only problem is somewhere on the physical part of the interface. If you are seeing signals on the scope, means that you may send dat ok. if you have checked that your USB-serial dongle works good with events, look for the hw mistakes (wiring etc). If you haven't yet checked if your USB-serial dongle works good with events read this: http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html AND always remember that USB-serial dongle isn't serial COM port, this is VIRTUAL Com Port. And this may make a big difference... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t function. > I am then trying to debug 2 sets of code, instead of working from a good set > to get my ?bad? set to work correctly. > > > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on the > transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is parsing > the messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up as > a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:40 PM > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't > the same ? > > Regards > Mariusz > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Fri Jun 25 01:54:39 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 25 Jun 2010 08:54:39 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: <4C23DB47.5070308@ergotech.com> References: <4C23DB47.5070308@ergotech.com> Message-ID: I'm happily using RXTX to communicate with RS422 devices in 4-wire mode using KK-Systems K2 RS232-RS422/RS485 converters (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). Running at 115200 baud -- no issues at all. Regards, Michael Erskine. From jredman at ergotech.com Fri Jun 25 11:29:10 2010 From: jredman at ergotech.com (Jim Redman) Date: Fri, 25 Jun 2010 11:29:10 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <4C23DB47.5070308@ergotech.com> Message-ID: <4C24E766.50102@ergotech.com> Note that the K2 doesn't do automatic switching for RS485, the K2-ADE does. For true RS422 this is irrelevant. We've used a bunch of converters, including some USB versions, some from B&B (http://www.bb-elec.com/) and some (a lot?) of the non-name, low cost RS232-RS485 converters that are out there. There really is no difference as far as the software is concerned. The cabling and termination of 485/422 do tend to be more problematic, and it's likely that the problem lies there rather than anywhere else. Jim On 06/25/2010 01:54 AM, Michael Erskine wrote: > I'm happily using RXTX to communicate with RS422 devices in 4-wire > mode using KK-Systems K2 RS232-RS422/RS485 converters > (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). > Running at 115200 baud -- no issues at all. > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From robohobby at gmail.com Sun Jun 27 07:41:33 2010 From: robohobby at gmail.com (Oleg Lyubchenko) Date: Sun, 27 Jun 2010 17:41:33 +0400 Subject: [Rxtx] Is it possible to receive data from serial port, using RXTX under Linux? Message-ID: Hi, I am trying to use RxTx for a simple project. Small board ETX should communicate with several devices, using serial ports. The application should work under Linux. Java is my favorite language and that was the reason, why RXTX was selected for the task. Under Windows all was OK. But under Linux I see strange thing - It is possible to send data to the port, but it is impossible to read data from port under Linux. Lock files are OK - this part work as it should. User (the user is 'root') has permissions to read-write to port (to device). Kermit and minicom works fine with the modem. The application can send data, but can not read data. As a test example I use standard example class - TwoWaySerialComm.java . I tried both versions of this file - one version without Events and version with Events. I see the same picture with Puppy Linux, with Ubuntu 9.10, OpenSuSE 11. As a hardware I use ETX board and notebook Samsung R40. Both platforms shows the same result - can write to port, can not read from port. What I mean by "send and receive data": I do very simple test - after connection to the device I type "atz" and waiting for the answer from the modem. Normal answer should be "OK". Under Windows, using "TwoWaySerialComm" I see : ATZ ATZ OK Under Linux I see only ATZ ATZ (No normal answer 'OK') Any ideas? PS: If you want to see the code, you can download the code of the project from http://www.robohobby.com/downloads/JavaRxTx.zip There is nothing special there - just project for Netbeans with code of two standard examples. to run it under Windows, use JavaRxTx\r.bat for Linux, use JavaRxTx\sh r.sh Sincerely, Oleg -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at iDIAcomputing.com Sun Jun 27 08:16:25 2010 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 27 Jun 2010 10:16:25 -0400 Subject: [Rxtx] Is it possible to receive data from serial port, using RXTX under Linux? In-Reply-To: References: Message-ID: <4C275D39.3060005@iDIAcomputing.com> Oleg On 6/27/10 9:41 AM, Oleg Lyubchenko wrote: > Under Windows, using "TwoWaySerialComm" I see : > ATZ > ATZ > OK > > Under Linux > I see only > ATZ > ATZ > > (No normal answer 'OK') > > Any ideas? > > PS: If you want to see the code, you can download the code of the > project from > http://www.robohobby.com/downloads/JavaRxTx.zip > There is nothing special there - just project for Netbeans with code of > two standard examples. > > to run it under Windows, use > JavaRxTx\r.bat > for Linux, use JavaRxTx\sh r.sh Oleg, I've not looked at your code, but are you sending both a carriage return and a linefeed to the modem? Windows will generally send both for a \n but Linux will generally only send a linefeed. You may need to use \r\n to get both. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From djjames at drs-ssi.com Mon Jun 28 07:40:32 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Mon, 28 Jun 2010 08:40:32 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: All, I have a box that has RS422 native, the sender of some data. I have another box that has RS422 native. My software runs on this machine. This is where my problem lies. I think I confused the issue with my statement about the 422/232 converter. I have the converter in my test setup to make certain that the sender was sending what I expected, hooked to a laptop with hyperterm. The production setup will have no converters. It cannot have a converter. I have another box on which I have to communicate via RS232. I have that communications up and running. I get the correct information out of my RS232 link. +------+ RS422 +----+ RS232 +-------+ |Sender|-------| Me |-------|Another| +------+ +----+ | Sender| +-------+ On the scope, I have verified that the RS422 sender is setting the transmit lines correctly. I cannot get my side of the RS422 communications to work. I have set my RS422 configuration to be similar to the RS232 that does work. The only event that I am getting is output buffer empty, even though I have turned off that notification (422port.notifyOnOutputEmpty(false);). I have 422port.notifyOnDataAvilable(true), yet I never get that event. It doesn't seem that I have things setup correctly. I have configured the RS422 port per my interface spec with the RS422 sender, yet I don't get any data (no data available events!). If I can't get this to work, I will be writing my own (which isn't a nice thought). From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Friday, June 25, 2010 2:53 AM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, now you are sleeping and I have the next day :) So - "voltage interface" means that you have RS232 interface and voltage level converter to use it as RS422. In such case proper work of the RS232 determines proper work of the RS422 (if hw works). In case you make tests on physically different controllers, there may be a lot of traps more, especially now, when we have milions of USB/RS232 dongles vendors and milions of not-properly-working VCP-drivers. Your sentence: "dongle and a RS232 to RS422 converter hooked to" says that you have one RS232 controller and you are using "voltage interface" named >converter< to connect to external RS422 source. It means that only problem is somewhere on the physical part of the interface. If you are seeing signals on the scope, means that you may send dat ok. if you have checked that your USB-serial dongle works good with events, look for the hw mistakes (wiring etc). If you haven't yet checked if your USB-serial dongle works good with events read this: http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html AND always remember that USB-serial dongle isn't serial COM port, this is VIRTUAL Com Port. And this may make a big difference... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I agree with the RS422/RS485/RS232 control side being the same. Everything I have read says that this should be so. I did notice that there is a RS485 implementation within RxTx that RS485Port.java states is "Non functional". I was thinking that I could/should use the RS485 code as a basis for the RS422 code, if necessary. But this seems a rash course of action if it doesn't function. I am then trying to debug 2 sets of code, instead of working from a good set to get my "bad" set to work correctly. 1) I don't understand the first question "does your RS422 is voltage interface to RS232?" What is "is voltage"? What is an "is voltage interface"? I apologize for my ignorance about this. I have a "true" RS422 port, +/- 5 volt differential if that is what you mean. There is no cross talk between the RS232 and RS422 that I can detect. I know that the RS422 port works, from the command line I have copied a file to that tty device and see voltage changes on my scope on the transmit+ and transmit- pins. 2) No USB dongles are involved in the "badness". That said, as a test, I have run the target java code on a laptop with a USB to serial dongle and a RS232 to RS422 converter hooked to my RS422 source and the serial communications is great. I know that my messaging code is parsing the messages and that the RxTx RS232 code is getting the correct interrupts for the raw data to build the messages up from the raw data. 3) See 2). When I enumerate the ports on my Linux machine, the RS422 port shows up as a serial port. portList = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier foundPortId = null; while (portList.hasMoreElements()) { portId = (gnu.io.CommPortIdentifier) portList.nextElement(); int portType = portId.getPortType(); System.out.println("Found port " + portId.getName()); System.out.println(" of port type " + portId.getPortType()); if (portType == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { portFound = true; foundPortId = portId; } } } I hope this is the information that you requested. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:40 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Jun 28 08:18:08 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 28 Jun 2010 17:18:08 +0300 Subject: [Rxtx] Port to RS422? In-Reply-To: Message-ID: > If I can?t get this to work, I will be writing my own (which isn?t a nice > thought). As stated, from the software point of view RSxxx are identical (or if there is a critical difference lurking somewhere in the details, you are screwed), so I would think that if you roll your own you will run into a similar problem that you are having with rxtx, thus is makes sense to figure out first *what* is the problem here, and then see if you need to write your own. Just my 2 snt, but I've been there, done that. br Kusti From jredman at ergotech.com Mon Jun 28 12:32:38 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 28 Jun 2010 12:32:38 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C28EAC6.8030908@ergotech.com> RS422 is multi-drop. If you just want to monitor what is going on (for debugging or other reasons) connect the two native RS422 systems together (if you can test that these are working at this point so much the better) then add the RS422 converter to the same lines - no need for a pass through. So you'll have: | RS422 |-------------------| RS422 | | | [ RS422 Converter ] The converter will see all traffic and can talk on the line (but that might confuse the other two components. Jim On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From jredman at ergotech.com Mon Jun 28 12:43:57 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 28 Jun 2010 12:43:57 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C28ED6D.2040807@ergotech.com> Just out of interest, what's the make/model of RS422 converter you're using? On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From andy at g0poy.com Mon Jun 28 15:12:00 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 28 Jun 2010 22:12:00 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <20100628221200.6ca3052d@workstation.site> Try TeraTerm rather than Hyperterm just in case that is the problem. http://www.ayera.com/teraterm/ I have known Hyperterm to do all sorts of things you don't tell it. (We gave up asking customers to use it) Sometimes it would receive OK, other times not. We never found out exactly what upset it. Generally we would be using it at 9600 8N1 so nothing special at all. After switching to TeraTerm we have no more problems. Andy On Mon, 28 Jun 2010 08:40:32 -0500 "James, David (DJ) (SA-1)" wrote: > All, > > > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > > > > > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > > > I cannot get my side of the RS422 communications to work. I have set > my RS422 configuration to be similar to the RS232 that does work. The > only event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn't seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don't get > any data (no data available events!). > > > > If I can't get this to work, I will be writing my own (which isn't a > nice thought). > > > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Friday, June 25, 2010 2:53 AM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and > voltage level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is "Non functional". I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn't > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my "bad" set to work correctly. > > > > 1) I don't understand the first question "does your RS422 is > voltage interface to RS232?" What is "is voltage"? What is an "is > voltage interface"? I apologize for my ignorance about this. > > > > I have a "true" RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the "badness". That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is > parsing the messages and that the RxTx RS232 code is getting the correct > interrupts for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:40 PM > > > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. > If this is a setup problem, I am confused as I set the two ports up > similarly. > > > > Thanks, > > DJ > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:18 PM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > From djjames at drs-ssi.com Mon Jun 28 15:28:24 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Mon, 28 Jun 2010 16:28:24 -0500 Subject: [Rxtx] RS422 converter model and (maybe) resolution. In-Reply-To: References: Message-ID: B&B Electronics 422PP9R. Things work great with it. It now appears to be the box. We were able to get another one in for testing and BlockBox is getting events as it should. He suggestion that it might be hardware was spot on. But (of course), you want to make certain that your stuff is working correctly before you accuse the other side of any wrong doing. Thanks for all the advice! DJ -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Monday, June 28, 2010 3:26 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 34, Issue 11 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. Re: Port to RS422? (Kustaa Nyholm) 2. Re: Port to RS422? (Jim Redman) 3. Re: Port to RS422? (Jim Redman) 4. Re: Port to RS422? (Andy Eskelson) ---------------------------------------------------------------------- Message: 1 Date: Mon, 28 Jun 2010 17:18:08 +0300 From: Kustaa Nyholm To: "rxtx at qbang.org" Subject: Re: [Rxtx] Port to RS422? Message-ID: Content-Type: text/plain; charset="iso-8859-1" > If I can?t get this to work, I will be writing my own (which isn?t a nice > thought). As stated, from the software point of view RSxxx are identical (or if there is a critical difference lurking somewhere in the details, you are screwed), so I would think that if you roll your own you will run into a similar problem that you are having with rxtx, thus is makes sense to figure out first *what* is the problem here, and then see if you need to write your own. Just my 2 snt, but I've been there, done that. br Kusti ------------------------------ Message: 2 Date: Mon, 28 Jun 2010 12:32:38 -0600 From: Jim Redman To: RXTX Developers and Users Subject: Re: [Rxtx] Port to RS422? Message-ID: <4C28EAC6.8030908 at ergotech.com> Content-Type: text/plain; charset=windows-1252; format=flowed RS422 is multi-drop. If you just want to monitor what is going on (for debugging or other reasons) connect the two native RS422 systems together (if you can test that these are working at this point so much the better) then add the RS422 converter to the same lines - no need for a pass through. So you'll have: | RS422 |-------------------| RS422 | | | [ RS422 Converter ] The converter will see all traffic and can talk on the line (but that might confuse the other two components. Jim On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com ------------------------------ Message: 3 Date: Mon, 28 Jun 2010 12:43:57 -0600 From: Jim Redman Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Message-ID: <4C28ED6D.2040807 at ergotech.com> Content-Type: text/plain; charset=windows-1252; format=flowed Just out of interest, what's the make/model of RS422 converter you're using? On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com ------------------------------ Message: 4 Date: Mon, 28 Jun 2010 22:12:00 +0100 From: Andy Eskelson To: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Message-ID: <20100628221200.6ca3052d at workstation.site> Content-Type: text/plain; charset=US-ASCII Try TeraTerm rather than Hyperterm just in case that is the problem. http://www.ayera.com/teraterm/ I have known Hyperterm to do all sorts of things you don't tell it. (We gave up asking customers to use it) Sometimes it would receive OK, other times not. We never found out exactly what upset it. Generally we would be using it at 9600 8N1 so nothing special at all. After switching to TeraTerm we have no more problems. Andy On Mon, 28 Jun 2010 08:40:32 -0500 "James, David (DJ) (SA-1)" wrote: > All, > > > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > > > > > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > > > I cannot get my side of the RS422 communications to work. I have set > my RS422 configuration to be similar to the RS232 that does work. The > only event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn't seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don't get > any data (no data available events!). > > > > If I can't get this to work, I will be writing my own (which isn't a > nice thought). > > > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Friday, June 25, 2010 2:53 AM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and > voltage level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is "Non functional". I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn't > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my "bad" set to work correctly. > > > > 1) I don't understand the first question "does your RS422 is > voltage interface to RS232?" What is "is voltage"? What is an "is > voltage interface"? I apologize for my ignorance about this. > > > > I have a "true" RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the "badness". That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is > parsing the messages and that the RxTx RS232 code is getting the correct > interrupts for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:40 PM > > > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. > If this is a setup problem, I am confused as I set the two ports up > similarly. > > > > Thanks, > > DJ > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:18 PM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > 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 End of Rxtx Digest, Vol 34, Issue 11 ************************************ From msemtd at googlemail.com Tue Jun 29 04:05:10 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 29 Jun 2010 11:05:10 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: <20100628221200.6ca3052d@workstation.site> References: <20100628221200.6ca3052d@workstation.site> Message-ID: On 28 June 2010 22:12, Andy Eskelson wrote: > Try TeraTerm rather than Hyperterm just in case that is the problem. > http://www.ayera.com/teraterm/ I recommend RealTerm over teraterm pro (proper FOSS licence, you get the source code, actively maintained, etc.): http://realterm.sourceforge.net/ Regards, Michael Erskine. From mariusz.dec at gmail.com Tue Jun 29 04:37:25 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 29 Jun 2010 12:37:25 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <20100628221200.6ca3052d@workstation.site> Message-ID: Hi, a bit from my experience :). I am using my own terminals only. Why? Because good transmission practice says that in data packet should be a header, trailer, checksum, block length etc. My terminals (software like Hyperterm) for each project have a simple current protocols parsers and shows important data in clear form. Additionally I can see whole time of the developing that second side of the transmission path works good as well (for example - good checksum arrives). Currently I am receiving /sendign quite large packets - about 50 bytes - how to look inside without tools? This is easy to write ad-hoc specialized terminal and this helps a lot :). Regards Mariusz 2010/6/29 Michael Erskine > On 28 June 2010 22:12, Andy Eskelson wrote: > > Try TeraTerm rather than Hyperterm just in case that is the problem. > > http://www.ayera.com/teraterm/ > > I recommend RealTerm over teraterm pro (proper FOSS licence, you get > the source code, actively maintained, etc.): > http://realterm.sourceforge.net/ > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Tue Jun 29 08:23:24 2010 From: jredman at ergotech.com (Jim Redman) Date: Tue, 29 Jun 2010 08:23:24 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <20100628221200.6ca3052d@workstation.site> Message-ID: <4C2A01DC.50200@ergotech.com> If you're on Windows and just trying to snoop the communications, then the Sysinternals "PortMon" can be useful: http://technet.microsoft.com/en-us/sysinternals/bb795533.aspx It looks as though RealTerm might have a similar feature. Jim On 06/29/2010 04:37 AM, Mariusz Dec wrote: > Hi, > a bit from my experience :). > > I am using my own terminals only. > Why? > Because good transmission practice says that in data packet should be a > header, trailer, checksum, block length etc. > My terminals (software like Hyperterm) for each project have a simple > current protocols parsers and shows important data in clear form. > Additionally I can see whole time of the developing that second side of > the transmission path works good as well (for example - good checksum > arrives). > Currently I am receiving /sendign quite large packets - about 50 bytes - > how to look inside without tools? > > This is easy to write ad-hoc specialized terminal and this helps a lot :). > > Regards > Mariusz > > > > 2010/6/29 Michael Erskine > > > On 28 June 2010 22:12, Andy Eskelson > wrote: > > Try TeraTerm rather than Hyperterm just in case that is the problem. > > http://www.ayera.com/teraterm/ > > I recommend RealTerm over teraterm pro (proper FOSS licence, you get > the source code, actively maintained, etc.): > http://realterm.sourceforge.net/ > > Regards, > Michael Erskine. > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From mariusz.dec at gmail.com Tue Jun 29 09:13:32 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Tue, 29 Jun 2010 17:13:32 +0200 Subject: [Rxtx] Port to RS422? References: <20100628221200.6ca3052d@workstation.site> <4C2A01DC.50200@ergotech.com> Message-ID: <260B5D1534CF44FF92AC19D9B016F177@mdam2> Hi, sysinternals has a lot of very usefull tools :). But in my projects binary data isn't enough when I receive some analog data from DAC's. This is voltage but as representation of temperature, pressure, voltage.... Easiest way is to do own terminal with simple parser. Now in the era of the USB/RS232 dongles another usefull tool is "just connected COM port finder"... I did it and work is comfortable - no more system crashes when disconecting USB while terminal is working. The most difficult was the first step after fight with Hyperterm few years ago... :) Regards :) Mariusz ----- Original Message ----- From: "Jim Redman" Cc: Sent: Tuesday, June 29, 2010 4:23 PM Subject: Re: [Rxtx] Port to RS422? > If you're on Windows and just trying to snoop the communications, then > the Sysinternals "PortMon" can be useful: > > http://technet.microsoft.com/en-us/sysinternals/bb795533.aspx > > It looks as though RealTerm might have a similar feature. > > Jim > > On 06/29/2010 04:37 AM, Mariusz Dec wrote: >> Hi, >> a bit from my experience :). >> >> I am using my own terminals only. >> Why? >> Because good transmission practice says that in data packet should be a >> header, trailer, checksum, block length etc. >> My terminals (software like Hyperterm) for each project have a simple >> current protocols parsers and shows important data in clear form. >> Additionally I can see whole time of the developing that second side of >> the transmission path works good as well (for example - good checksum >> arrives). >> Currently I am receiving /sendign quite large packets - about 50 bytes - >> how to look inside without tools? >> >> This is easy to write ad-hoc specialized terminal and this helps a lot :). >> >> Regards >> Mariusz >> >> >> >> 2010/6/29 Michael Erskine > > >> >> On 28 June 2010 22:12, Andy Eskelson > > wrote: >> > Try TeraTerm rather than Hyperterm just in case that is the problem. >> > http://www.ayera.com/teraterm/ >> >> I recommend RealTerm over teraterm pro (proper FOSS licence, you get >> the source code, actively maintained, etc.): >> http://realterm.sourceforge.net/ >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> 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 > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From andrea.antonello at gmail.com Tue Jun 29 14:39:49 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Tue, 29 Jun 2010 22:39:49 +0200 Subject: [Rxtx] wrapping rxtx in eclipse Message-ID: Hi developers, I am currently using rxtx in an eclipse based GIS project to connect to GPS via bluetooth. I found the http://rxtx.qbang.org/wiki/index.php/Wrapping_RXTX_in_an_Eclipse_Plugin page a great start to maintain platform "independency". We are currently working on eclipse 3.6 and created the rxtx plugins as they suggest to do them now using plugins and fragments. Currently the namespace of the plugin is ours with authors rxtx.org. I was thinking it probably would make more sense to create them with the rxtx namespace and make them downloadable here? So finally the question: - is it ok if I update the above wiki page with eclipse 3.6 instructions? - would there be interst for me maintaining the eclipse plugins for rxtx? - is it ok to add my project to the projects using rxtx? That's all, best regards, Andrea From karl.weber99 at gmx.net Wed Jun 30 03:17:26 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 30 Jun 2010 11:17:26 +0200 Subject: [Rxtx] wrapping rxtx in eclipse In-Reply-To: References: Message-ID: <201006301117.26265.karl.weber99@gmx.net> Am Dienstag, 29. Juni 2010 22:39 schrieb andrea antonello: > Hi developers, > I am currently using rxtx in an eclipse based GIS project to connect > to GPS via bluetooth. > I found the > http://rxtx.qbang.org/wiki/index.php/Wrapping_RXTX_in_an_Eclipse_Plugin > page a great start to maintain platform "independency". > > We are currently working on eclipse 3.6 and created the rxtx plugins > as they suggest to do them now using plugins and fragments. > Currently the namespace of the plugin is ours with authors rxtx.org. I > was thinking it probably would make more sense to create them with the > rxtx namespace and make them downloadable here? > So finally the question: > - is it ok if I update the above wiki page with eclipse 3.6 instructions? > - would there be interst for me maintaining the eclipse plugins for rxtx? > - is it ok to add my project to the projects using rxtx? > I am no OSGi expert, but if you think about maintaining an eclipse-plugin for rxtx, I would suggest a better solution, which should work, as far as I understand OSGi: (1) Create an OSGi-bundle. What I mean here is, that one should not use any eclipse / equinox specific stuff, so that this bundle can be used with other OSGi-frameworks as well. (2) Do not create a wrapper. If only java-classes where involved, the difference between an OSGi-Bundle and an ordinary jar-file was only some entries in the MANIFEST-header. So, instead of heaving a jar within a jar, I would prefer to have only one jar that is an OSGi-Bundle. Such OSGi-Bundle can also be used outside of any OSGi-framework, as ordinary jar-file. That rxtx involves c-libraries should not make much difference. In addition to the java-classes the (single) jar should also contain the libs. It would also be nice, to enhance the rxtx build-service, such that it can create such OSGi-bundles from the sources. /Karl P.S. I am currently also using a wrapper plug-in, but I am not happy with this solution... From andrea.antonello at gmail.com Wed Jun 30 04:07:24 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Wed, 30 Jun 2010 12:07:24 +0200 Subject: [Rxtx] wrapping rxtx in eclipse In-Reply-To: <201006301117.26265.karl.weber99@gmx.net> References: <201006301117.26265.karl.weber99@gmx.net> Message-ID: Hi Karl, I think your suggestions are good. The problem is that I am also no Osgi specialist. I can ensure a continuity in maintainment and bugfixes only by proposing something I would do anyways, which is keeping up the plugins and fragments for my project. For something something different I am afraid that after few time it would get of low priority in my list of job tasks and I prefer to not take that path. Andrea On Wed, Jun 30, 2010 at 11:17 AM, Karl Weber wrote: > Am Dienstag, 29. Juni 2010 22:39 schrieb andrea antonello: >> Hi developers, >> I am currently using rxtx in an eclipse based GIS project to connect >> to GPS via bluetooth. >> I found the >> http://rxtx.qbang.org/wiki/index.php/Wrapping_RXTX_in_an_Eclipse_Plugin >> page a great start to maintain platform "independency". >> >> We are currently working on eclipse 3.6 and created the rxtx plugins >> as they suggest to do them now using plugins and fragments. >> Currently the namespace of the plugin is ours with authors rxtx.org. I >> was thinking it probably would make more sense to create them with the >> rxtx namespace and make them downloadable here? >> So finally the question: >> - is it ok if I update the above wiki page with eclipse 3.6 instructions? >> - would there be interst for me maintaining the eclipse plugins for rxtx? >> - is it ok to add my project to the projects using rxtx? >> > > I am no OSGi expert, but if you think about maintaining an eclipse-plugin for > rxtx, I would suggest a better solution, which should work, as far as I > understand OSGi: > > (1) Create an OSGi-bundle. What I mean here is, that one should not use any > eclipse / equinox specific stuff, so that this bundle can be used with other > OSGi-frameworks as well. > > (2) Do not create a wrapper. If only java-classes where involved, the > difference between an OSGi-Bundle and an ordinary jar-file was only some > entries in the MANIFEST-header. So, instead of heaving a jar within a jar, I > would prefer to have only one jar that is an OSGi-Bundle. Such OSGi-Bundle > can also be used outside of any OSGi-framework, as ordinary jar-file. > > That rxtx involves c-libraries should not make much difference. In addition to > the java-classes the (single) jar should also contain the libs. > > It would also be nice, to enhance the rxtx build-service, such that it can > create such OSGi-bundles from the sources. > > /Karl > > > P.S. I am currently also using a wrapper plug-in, but I am not happy with this > solution... > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From leo.guimaraes at gmail.com Fri Jun 18 13:29:14 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Fri, 18 Jun 2010 15:29:14 -0400 Subject: [Rxtx] Virtual Port with RXTX Message-ID: Hello everybody, Please, im crazy trying to solve this problem: I created a virtual port in my server to receive data over the ethernet from a serial port in the client machine. Im using socat for that: In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: 192.168.102.41:54321 its working fine for me, accessing the virtual port via CuteCom or any terminal. But i can't access this port via RXTX. The getPortIdentifiers() method returns only the /dev/ttyS0 port. Please guys, could you help me about that? Thank you very much! Leandro Guimar?es -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Fri Jun 18 23:43:50 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 19 Jun 2010 07:43:50 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: Hi, In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: > 192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or any > terminal. But i can't access this port via RXTX. The getPortIdentifiers() > method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock Try to change name of the virtual port. I suppose you are using Linux, so: In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid prefixes for the Linux com ports. Add your prefix there or change your VCP name to match to any predefined prefix there. Regards Mariusz > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Sat Jun 19 08:03:06 2010 From: jredman at ergotech.com (Jim Redman) Date: Sat, 19 Jun 2010 08:03:06 -0600 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: <4C1CCE1A.90201@ergotech.com> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports so: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 or whatever you need for the virtual port. The ports will enumerate in the order give (I don't know whether this is a guaranteed behavior or just the way it happens to be). Jim On 06/18/2010 11:43 PM, Mariusz Dec wrote: > Hi, > > In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > tcp:192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or > any terminal. But i can't access this port via RXTX. The > getPortIdentifiers() method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork > file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > > Try to change name of the virtual port. > > I suppose you are using Linux, so: > > In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > prefixes for the Linux com ports. > Add your prefix there or change your VCP name to match to any predefined > prefix there. > > Regards > Mariusz > > > > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From leo.guimaraes at gmail.com Mon Jun 21 13:23:26 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 16:23:26 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: <4C1CCE1A.90201@ergotech.com> References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hello, Change my virtual port to ttySXX worked fine... But now, im having another problem... I dont know why, but the virtual port is never calling the SerialEvent in the SerialPortEventListenner... using the real Serial port, works fine. But it doesnt work with the virtual port... Somebody have an idea?? Pleasse! Thank you!! Leandro Guimar?es On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: > You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > so: > > > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > > or whatever you need for the virtual port. The ports will enumerate in the > order give (I don't know whether this is a guaranteed behavior or just the > way it happens to be). > > Jim > > > > > On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> Hi, >> >> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave >> tcp:192.168.102.41:54321 >> >> >> its working fine for me, accessing the virtual port via CuteCom or >> any terminal. But i can't access this port via RXTX. The >> getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >> Please guys, could you help me about that? >> >> >> In client machine: socat tcp-l:54321,reuseaddr,fork >> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >> Try to change name of the virtual port. >> >> I suppose you are using Linux, so: >> >> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> prefixes for the Linux com ports. >> Add your prefix there or change your VCP name to match to any predefined >> prefix there. >> >> Regards >> Mariusz >> >> >> >> Thank you very much! >> Leandro Guimar?es >> >> >> _______________________________________________ >> 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 >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > > _______________________________________________ > 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 Mon Jun 21 13:47:13 2010 From: george.dma at gmail.com (George H) Date: Mon, 21 Jun 2010 19:47:13 +0000 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, This might be because it is a virtual port. I used to do testing on usb/serial port and there were some "signals" it would not send me that a real serial port would. Try to see what signals your serial port sends you that the virtual port doesn't. I think there are some serial port sniffers out there where you can intercept the signals. Also would do good if you look at some technical tutorials on how serial port signals work. A good site which I read over many times to try to understand why things are the way they are is http://www.arcelect.com/rs232.htm I hope this gave you some ideas. Good luck -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Hello, > > ?? Change my virtual port to ttySXX worked fine... > > ?? But now, im having another problem... > > ? I dont know why, but the virtual port is never calling the SerialEvent in > the SerialPortEventListenner... using the real Serial port, works fine. But > it doesnt work with the virtual port... > > > ?? Somebody have an idea?? Pleasse! > > Thank you!! > Leandro Guimar?es > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports >> so: >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> the order give (I don't know whether this is a guaranteed behavior or just >> the way it happens to be). >> >> Jim >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >>> >>> Hi, >>> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >>> ? ?tcp:192.168.102.41:54321 >>> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >>> ? ?any terminal. But i can't access this port via RXTX. The >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >>> >>> ? ? ? Please guys, could you help me about that? >>> >>> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >>> >>> Try to change name of the virtual port. >>> >>> I suppose you are using Linux, so: >>> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >>> prefixes for the Linux com ports. >>> Add your prefix there or change your VCP name to match to any predefined >>> prefix there. >>> >>> Regards >>> Mariusz >>> >>> >>> >>> ? ?Thank you very much! >>> ? ?Leandro Guimar?es >>> >>> >>> ? ?_______________________________________________ >>> ? ?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 >> >> -- >> Jim Redman >> (505) 662 5156 x85 >> http://www.ergotech.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From leo.guimaraes at gmail.com Mon Jun 21 14:56:15 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 17:56:15 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Thanks George, Please, do you know what represents a "data available" in RXTX? Wich signal calls the Listener's Notify? Its the last thing that i need to do to finish my project here! Thank you very much! Leandro Guimar?es 2010/6/21 George H > Hi, > > This might be because it is a virtual port. > I used to do testing on usb/serial port and there were some "signals" > it would not send me that a real serial port would. > Try to see what signals your serial port sends you that the virtual > port doesn't. I think there are some serial port sniffers out there > where you can intercept the signals. Also would do good if you look at > some technical tutorials on how serial port signals work. > > A good site which I read over many times to try to understand why > things are the way they are is http://www.arcelect.com/rs232.htm > > I hope this gave you some ideas. > Good luck > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Hello, > > > > Change my virtual port to ttySXX worked fine... > > > > But now, im having another problem... > > > > I dont know why, but the virtual port is never calling the SerialEvent > in > > the SerialPortEventListenner... using the real Serial port, works fine. > But > > it doesnt work with the virtual port... > > > > > > Somebody have an idea?? Pleasse! > > > > Thank you!! > > Leandro Guimar?es > > > > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > wrote: > >> > >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > >> so: > >> > >> > >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> > >> or whatever you need for the virtual port. The ports will enumerate in > >> the order give (I don't know whether this is a guaranteed behavior or > just > >> the way it happens to be). > >> > >> Jim > >> > >> > >> > >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >>> > >>> Hi, > >>> > >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >>> tcp:192.168.102.41:54321 > >>> > >>> its working fine for me, accessing the virtual port via CuteCom or > >>> any terminal. But i can't access this port via RXTX. The > >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >>> > >>> Please guys, could you help me about that? > >>> > >>> > >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >>> > >>> Try to change name of the virtual port. > >>> > >>> I suppose you are using Linux, so: > >>> > >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >>> prefixes for the Linux com ports. > >>> Add your prefix there or change your VCP name to match to any > predefined > >>> prefix there. > >>> > >>> Regards > >>> Mariusz > >>> > >>> > >>> > >>> Thank you very much! > >>> Leandro Guimar?es > >>> > >>> > >>> _______________________________________________ > >>> 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 > >> > >> -- > >> Jim Redman > >> (505) 662 5156 x85 > >> http://www.ergotech.com > >> _______________________________________________ > >> 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 george.dma at gmail.com Mon Jun 21 22:51:50 2010 From: george.dma at gmail.com (George H) Date: Tue, 22 Jun 2010 07:51:50 +0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Did you read the site I posted? If you did you would have figured out which pin signal on the RS232 interface most likely triggers the data available event. It might be pin 2 and it might be pin 3, depends what kind of serial port you have and the cable. Plus i'm no expert on on RS-232 interfaces, I just know that if I have my hardware in front of me, and the source code of rxtx and a rs-232 specifications sheet then I can debug the problem and find out. This is what I believe you should do to get started to find out the "what, where and why" of your problem. -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Thanks George, > > ?? Please, do you know what represents a "data available" in RXTX? Wich > signal calls the Listener's Notify? > > ?? Its the last thing that i need to do to finish my project here! > > Thank you very much! > > Leandro Guimar?es > > > 2010/6/21 George H >> >> Hi, >> >> This might be because it is a virtual port. >> I used to do testing on usb/serial port and there were some "signals" >> it would not send me that a real serial port would. >> Try to see what signals your serial port sends you that the virtual >> port doesn't. I think there are some serial port sniffers out there >> where you can intercept the signals. Also would do good if you look at >> some technical tutorials on how serial port signals work. >> >> A good site which I read over many times to try to understand why >> things are the way they are is http://www.arcelect.com/rs232.htm >> >> I hope this gave you some ideas. >> Good luck >> -- >> George H >> george.dma at gmail.com >> >> >> >> 2010/6/21 Leandro Guimar?es : >> > Hello, >> > >> > ?? Change my virtual port to ttySXX worked fine... >> > >> > ?? But now, im having another problem... >> > >> > ? I dont know why, but the virtual port is never calling the SerialEvent >> > in >> > the SerialPortEventListenner... using the real Serial port, works fine. >> > But >> > it doesnt work with the virtual port... >> > >> > >> > ?? Somebody have an idea?? Pleasse! >> > >> > Thank you!! >> > Leandro Guimar?es >> > >> > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman >> > wrote: >> >> >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of >> >> ports >> >> so: >> >> >> >> >> >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> >> the order give (I don't know whether this is a guaranteed behavior or >> >> just >> >> the way it happens to be). >> >> >> >> Jim >> >> >> >> >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >> >>> >> >>> Hi, >> >>> >> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >> >>> ? ?tcp:192.168.102.41:54321 >> >>> >> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >> >>> ? ?any terminal. But i can't access this port via RXTX. The >> >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >>> >> >>> ? ? ? Please guys, could you help me about that? >> >>> >> >>> >> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >>> >> >>> Try to change name of the virtual port. >> >>> >> >>> I suppose you are using Linux, so: >> >>> >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> >>> prefixes for the Linux com ports. >> >>> Add your prefix there or change your VCP name to match to any >> >>> predefined >> >>> prefix there. >> >>> >> >>> Regards >> >>> Mariusz >> >>> >> >>> >> >>> >> >>> ? ?Thank you very much! >> >>> ? ?Leandro Guimar?es >> >>> >> >>> >> >>> ? ?_______________________________________________ >> >>> ? ?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 >> >> >> >> -- >> >> Jim Redman >> >> (505) 662 5156 x85 >> >> http://www.ergotech.com >> >> _______________________________________________ >> >> Rxtx mailing list >> >> Rxtx at qbang.org >> >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > >> > _______________________________________________ >> > Rxtx mailing list >> > Rxtx at qbang.org >> > http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > > > From mariusz.dec at gmail.com Tue Jun 22 05:32:01 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 22 Jun 2010 13:32:01 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, I am working with virtual ports only. Because of some problems with events I have changed whole idea. I did a thread in Java which is looking for port data in pool. If data comes in, I parse it and than generate an Java exception for the application. This works very good from several months and has an advantage more - is faster than events services. I have published many times an example code. Look for 2009'november thread "RXTX close() problem solved". In this example you can set Exception generation in read thread. There is a lot of "try-catch" loops which prevents system while you disconnect USB as well. For me works very good in Mac/Linux and Windows. Regards Mariusz 2010/6/22 George H > Did you read the site I posted? If you did you would have figured out > which pin signal on the RS232 interface most likely triggers the data > available event. > It might be pin 2 and it might be pin 3, depends what kind of serial > port you have and the cable. > > Plus i'm no expert on on RS-232 interfaces, I just know that if I have > my hardware in front of me, and the source code of rxtx and a rs-232 > specifications sheet then I can debug the problem and find out. This > is what I believe you should do to get started to find out the "what, > where and why" of your problem. > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Thanks George, > > > > Please, do you know what represents a "data available" in RXTX? Wich > > signal calls the Listener's Notify? > > > > Its the last thing that i need to do to finish my project here! > > > > Thank you very much! > > > > Leandro Guimar?es > > > > > > 2010/6/21 George H > >> > >> Hi, > >> > >> This might be because it is a virtual port. > >> I used to do testing on usb/serial port and there were some "signals" > >> it would not send me that a real serial port would. > >> Try to see what signals your serial port sends you that the virtual > >> port doesn't. I think there are some serial port sniffers out there > >> where you can intercept the signals. Also would do good if you look at > >> some technical tutorials on how serial port signals work. > >> > >> A good site which I read over many times to try to understand why > >> things are the way they are is http://www.arcelect.com/rs232.htm > >> > >> I hope this gave you some ideas. > >> Good luck > >> -- > >> George H > >> george.dma at gmail.com > >> > >> > >> > >> 2010/6/21 Leandro Guimar?es : > >> > Hello, > >> > > >> > Change my virtual port to ttySXX worked fine... > >> > > >> > But now, im having another problem... > >> > > >> > I dont know why, but the virtual port is never calling the > SerialEvent > >> > in > >> > the SerialPortEventListenner... using the real Serial port, works > fine. > >> > But > >> > it doesnt work with the virtual port... > >> > > >> > > >> > Somebody have an idea?? Pleasse! > >> > > >> > Thank you!! > >> > Leandro Guimar?es > >> > > >> > > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > >> > wrote: > >> >> > >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of > >> >> ports > >> >> so: > >> >> > >> >> > >> >> > >> >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> >> > >> >> or whatever you need for the virtual port. The ports will enumerate > in > >> >> the order give (I don't know whether this is a guaranteed behavior or > >> >> just > >> >> the way it happens to be). > >> >> > >> >> Jim > >> >> > >> >> > >> >> > >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> >>> > >> >>> Hi, > >> >>> > >> >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >> >>> tcp:192.168.102.41:54321 > >> >>> > >> >>> its working fine for me, accessing the virtual port via CuteCom > or > >> >>> any terminal. But i can't access this port via RXTX. The > >> >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >> >>> > >> >>> Please guys, could you help me about that? > >> >>> > >> >>> > >> >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >> >>> > >> >>> Try to change name of the virtual port. > >> >>> > >> >>> I suppose you are using Linux, so: > >> >>> > >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >> >>> prefixes for the Linux com ports. > >> >>> Add your prefix there or change your VCP name to match to any > >> >>> predefined > >> >>> prefix there. > >> >>> > >> >>> Regards > >> >>> Mariusz > >> >>> > >> >>> > >> >>> > >> >>> Thank you very much! > >> >>> Leandro Guimar?es > >> >>> > >> >>> > >> >>> _______________________________________________ > >> >>> 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 > >> >> > >> >> -- > >> >> Jim Redman > >> >> (505) 662 5156 x85 > >> >> http://www.ergotech.com > >> >> _______________________________________________ > >> >> 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 > >> > > >> > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Tue Jun 22 07:20:17 2010 From: showard314 at gmail.com (Scott Howard) Date: Tue, 22 Jun 2010 09:20:17 -0400 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails Message-ID: This is forwarded from: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472053 by Jan Niehusmann I tried putting this on the bug tracker but I couldn't get access In the static initializer of gnu.io.RXTXPort, an exception when initializing the static variable 'z' is silently discarded: try { z = new Zystem(); } catch ( Exception e ) {}; This leads to NullPointerExceptions later, which are difficult to debug as the original exception is lost. I did change the code to try { z = new Zystem(); } catch ( Exception e ) { throw new Error(e.toString()); }; for debugging. Probably a more specific exception would be more appropriate, but the point is that leaving z undefined without reporting an error makes debugging unnecessarily difficult. Thanks. From g3vbv at blueyonder.co.uk Tue Jun 22 19:20:11 2010 From: g3vbv at blueyonder.co.uk (Sid Boyce) Date: Wed, 23 Jun 2010 02:20:11 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar Message-ID: <4C21614B.3060504@blueyonder.co.uk> I am using openSUSE 11.3 RC1. "rfcomm -a" lists no devices From dmesg =========== [288811.093151] usb 2-4.4.2: new full speed USB device using ehci_hcd and address 16 [288811.207421] usb 2-4.4.2: New USB device found, idVendor=0403, idProduct=6001 [288811.207431] usb 2-4.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [288811.207438] usb 2-4.4.2: Product: FT232R USB UART [288811.207443] usb 2-4.4.2: Manufacturer: FTDI [288811.207447] usb 2-4.4.2: SerialNumber: A100efz7 [288811.210509] ftdi_sio 2-4.4.2:1.0: FTDI USB Serial Device converter detected [288811.210534] usb 2-4.4.2: Detected FT232RL [288811.210536] usb 2-4.4.2: Number of endpoints 2 [288811.210538] usb 2-4.4.2: Endpoint 1 MaxPacketSize 64 [288811.210540] usb 2-4.4.2: Endpoint 2 MaxPacketSize 64 [288811.210541] usb 2-4.4.2: Setting MaxPacketSize 64 [288811.210822] usb 2-4.4.2: FTDI USB Serial Device converter now attached to ttyUSB1 Package built and installed OK in /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/amd64, it also installed /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/RXTXcomm.jar slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar RXTXcomm.jar Failed to load Main-Class manifest attribute from RXTXcomm.jar # rpm -qa |grep java java-1_6_0-sun-1.6.0.u20-1.15.x86_64 gcc44-java-4.4.2_20100116-1.2.x86_64 netbeans-javaparser-6.8-1.1.noarch gcc45-java-4.5.0_20100604-1.1.x86_64 ant-javadoc-1.7.1-11.1.noarch javahelp2-2.0.05-6.28.noarch gcc43-java-4.3.4_20091019-2.25.x86_64 gcc-java-4.5-5.2.x86_64 java-ca-certificates-1-5.1.noarch java-1_6_0-sun-devel-1.6.0.u20-1.15.x86_64 lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> echo $JAVA_HOME /usr/lib64/jvm/java-1.6.0-sun-1.6.0 > l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/amd64/ total 6440 drwxr-xr-x 8 root root 4096 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ drwxr-xr-x 2 root root 23 2010-06-18 16:41 headless/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 jli/ -rw-r--r-- 1 root root 652 2010-04-12 22:00 jvm.cfg -rwxr-xr-x 1 root root 15836 2010-04-12 22:25 libattach.so* -rwxr-xr-x 1 root root 757091 2010-04-12 22:25 libawt.so* -rwxr-xr-x 1 root root 413267 2010-04-12 22:25 libcmm.so* -rwxr-xr-x 1 root root 217736 2010-04-12 22:25 libdcpr.so* -rwxr-xr-x 1 root root 120029 2010-04-12 22:30 libdeploy.so* -rwxr-xr-x 1 root root 21670 2010-04-12 22:25 libdt_socket.so* -rwxr-xr-x 1 root root 692649 2010-04-12 22:25 libfontmanager.so* -rwxr-xr-x 1 root root 237073 2010-04-12 22:25 libhprof.so* -rwxr-xr-x 1 root root 50085 2010-04-12 22:25 libinstrument.so* -rwxr-xr-x 1 root root 27244 2010-04-12 22:25 libioser12.so* -rwxr-xr-x 1 root root 46723 2010-04-12 22:25 libj2gss.so* -rwxr-xr-x 1 root root 14272 2010-04-12 22:25 libj2pcsc.so* -rwxr-xr-x 1 root root 78017 2010-04-12 22:25 libj2pkcs11.so* -rwxr-xr-x 1 root root 7980 2010-04-12 22:25 libjaas_unix.so* -rwxr-xr-x 1 root root 28919 2010-04-12 22:25 libjava_crw_demo.so* -rwxr-xr-x 1 root root 231135 2010-04-12 22:25 libjava.so* -rwxr-xr-x 1 root root 7099 2010-04-12 22:25 libjawt.so* -rwxr-xr-x 1 root root 293725 2010-04-12 22:25 libjdwp.so* -rwxr-xr-x 1 root root 224947 2010-04-12 22:25 libjpeg.so* -rwxr-xr-x 1 root root 10964 2010-04-12 22:25 libjsig.so* -rwxr-xr-x 1 root root 260521 2010-04-12 22:25 libjsound.so* -rwxr-xr-x 1 root root 37449 2010-04-12 22:25 libmanagement.so* -rwxr-xr-x 1 root root 734280 2010-04-12 22:25 libmlib_image.so* -rwxr-xr-x 1 root root 6667 2010-04-12 22:25 libnative_chmod_g.so* -rwxr-xr-x 1 root root 6571 2010-04-12 22:25 libnative_chmod.so* -rwxr-xr-x 1 root root 111945 2010-04-12 22:25 libnet.so* -rwxr-xr-x 1 root root 43716 2010-04-12 22:25 libnio.so* -rwxr-xr-x 1 root root 15651 2010-04-12 22:25 libnpt.so* -rwxr-xr-x 1 root root 6420 2010-04-12 22:25 librmi.so* -rwxr-xr-x 1 root root 77907 2010-06-18 16:56 librxtxI2C-2.2pre1.so* -rw-r--r-- 1 root root 97530 2010-06-18 16:56 librxtxI2C.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxI2C.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxI2C.so -> librxtxI2C-2.2pre1.so* -rwxr-xr-x 1 root root 55253 2010-06-18 16:56 librxtxParallel-2.2pre1.so* -rw-r--r-- 1 root root 66164 2010-06-18 16:56 librxtxParallel.a -rwxr-xr-x 1 root root 1035 2010-06-18 16:56 librxtxParallel.la* lrwxrwxrwx 1 root root 26 2010-06-18 16:56 librxtxParallel.so -> librxtxParallel-2.2pre1.so* -rwxr-xr-x 1 root root 79049 2010-06-18 16:56 librxtxRaw-2.2pre1.so* -rw-r--r-- 1 root root 100218 2010-06-18 16:56 librxtxRaw.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxRaw.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxRaw.so -> librxtxRaw-2.2pre1.so* -rwxr-xr-x 1 root root 78134 2010-06-18 16:56 librxtxRS485-2.2pre1.so* -rw-r--r-- 1 root root 98662 2010-06-18 16:56 librxtxRS485.a -rwxr-xr-x 1 root root 1014 2010-06-18 16:56 librxtxRS485.la* lrwxrwxrwx 1 root root 23 2010-06-18 16:56 librxtxRS485.so -> librxtxRS485-2.2pre1.so* -rwxr-xr-x 1 root root 192681 2010-06-18 16:56 librxtxSerial-2.2pre1.so* -rw-r--r-- 1 root root 267524 2010-06-18 16:56 librxtxSerial.a -rwxr-xr-x 1 root root 1021 2010-06-18 16:56 librxtxSerial.la* lrwxrwxrwx 1 root root 24 2010-06-18 16:56 librxtxSerial.so -> librxtxSerial-2.2pre1.so* -rwxr-xr-x 1 root root 48036 2010-04-12 22:25 libsaproc.so* -rwxr-xr-x 1 root root 294575 2010-04-12 22:25 libsplashscreen.so* -rwxr-xr-x 1 root root 134786 2010-04-12 22:25 libunpack.so* -rwxr-xr-x 1 root root 66292 2010-04-12 22:25 libverify.so* -rwxr-xr-x 1 root root 91191 2010-04-12 22:25 libzip.so* drwxr-xr-x 2 root root 23 2010-06-18 16:41 motif21/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 native_threads/ drwxr-xr-x 2 root root 56 2010-06-18 16:41 server/ -rw------- 1 root root 0 2010-06-18 16:53 stC2p3qT -rw------- 1 root root 0 2010-06-18 16:53 stJpl8lW -rw------- 1 root root 0 2010-06-18 16:53 stnb1qWY -rw------- 1 root root 0 2010-06-18 16:53 stYjTgRS -rw------- 1 root root 0 2010-06-18 16:53 stZA8aVV drwxr-xr-x 2 root root 23 2010-06-18 16:41 xawt/ lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/ total 1300 drwxr-xr-x 2 root root 125 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ -rw-r--r-- 1 root root 8239 2010-04-12 22:08 dnsns.jar -rw-r--r-- 1 root root 842216 2010-06-10 12:45 localedata.jar -rw-r--r-- 1 root root 429 2010-04-12 22:23 meta-index -rwxr-xr-x 1 root root 61389 2010-06-18 16:56 RXTXcomm.jar* -rw-r--r-- 1 root root 170239 2010-04-12 21:58 sunjce_provider.jar -rw-r--r-- 1 root root 230608 2010-04-12 22:08 sunpkcs11.jar Help appreciated. 73 ... Sid. -- Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support Specialist, Cricket Coach Microsoft Windows Free Zone - Linux used for all Computing Tasks From Kustaa.Nyholm at planmeca.com Tue Jun 22 23:38:46 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 08:38:46 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: Message-ID: > I did change the code to > try { > z = new Zystem(); > } catch ( Exception e ) { > throw new Error(e.toString()); > }; Is there a reason why this could/should not be: > try { > z = new Zystem(); > } catch ( Throwable e ) { > e.printStackTrace(System.err); > }; From msemtd at googlemail.com Wed Jun 23 02:14:25 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:14:25 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar In-Reply-To: <4C21614B.3060504@blueyonder.co.uk> References: <4C21614B.3060504@blueyonder.co.uk> Message-ID: On 23 June 2010 02:20, Sid Boyce wrote: > slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar > RXTXcomm.jar > Failed to load Main-Class manifest attribute from > RXTXcomm.jar > Help appreciated. > 73 ... Sid. Well Sid, it's pretty obvious to me: you're trying to launch a jar that doesn't contain a main(). What exactly are you trying to achieve by running "java -jar RXTXcomm.jar"? Regards, Michael Erskine. From msemtd at googlemail.com Wed Jun 23 02:17:11 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:17:11 +0100 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: On 23 June 2010 06:38, Kustaa Nyholm wrote: > >> I did change the code to >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >> ? ? ? ? ? ? ? ?}; > > Is there a reason why this could/should not be: > > >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >> ? ? ? ? ? ? ? ?}; Or even just let the exception bubble up and kill whatever thread caused the class to load :) I vote for the removal of Zystem BTW! Regards, Michael Erskine. From george.dma at gmail.com Wed Jun 23 02:34:07 2010 From: george.dma at gmail.com (George H) Date: Wed, 23 Jun 2010 11:34:07 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: -- George H george.dma at gmail.com On Wed, Jun 23, 2010 at 11:17 AM, Michael Erskine wrote: > On 23 June 2010 06:38, Kustaa Nyholm wrote: >> >>> I did change the code to >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >>> ? ? ? ? ? ? ? ?}; >> >> Is there a reason why this could/should not be: >> >> >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >>> ? ? ? ? ? ? ? ?}; > > Or even just let the exception bubble up and kill whatever thread > caused the class to load :) > > I vote for the removal of Zystem BTW! > > Regards, > Michael Erskine. I would prefer that an exception is thrown rather than the stack trace be printed. If anyone is using loggers then it would be useful to catch the exception and log it, rather than let it come out in the error stream where no one might look. From Steffen.DETTMER at ingenico.com Wed Jun 23 03:28:45 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 11:28:45 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: <20100623092844.GF20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 08:38 +0300: > > I did change the code to > > try { > > z = new Zystem(); > > } catch ( Exception e ) { > > throw new Error(e.toString()); > > }; > > Is there a reason why this could/should not be: > > > try { > > z = new Zystem(); > > } catch ( Throwable e ) { > > e.printStackTrace(System.err); > > }; Is this intentionally not throwing the exception? Well, then it still would be discarded (althrough not neccesarily silently :)). BTW, I don't think System.err is a good idea. It is `statically initialized'? I think then this means it is unclear who the caller is and who could catch this exception. Wouldn't it be better to store the exception in a member and throw it when needing Zystem (e.g. in new or open)? 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 Kustaa.Nyholm at planmeca.com Wed Jun 23 03:55:30 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 12:55:30 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: >> Is there a reason why this could/should not be: >> >>> try { >>> z = new Zystem(); >>> } catch ( Throwable e ) { >>> e.printStackTrace(System.err); >>> }; > > Is this intentionally not throwing the exception? Well, no, just a hasty reply from my part. > still would be discarded (althrough not neccesarily silently :)). > BTW, I don't think System.err is a good idea. > > It is `statically initialized'? I think then this means it is > unclear who the caller is and who could catch this exception. > Even so re-throwing the exception would make sense so that the application developer has a chance to handle this in whichever way they want. Of course logically this should not then print the stacktrace because that is the responsibility of the application developer. But so many do not handle these cases sensibly so from the application user point of view it is nice to have something on the console to aid in trouble shooting. Have not checked the context in which this happens so that might influence my opinion. > Wouldn't it be better to store the exception in a member and > throw it when needing Zystem (e.g. in new or open) I'm of the fail-fast school of thought so I think it should be reported and re-thrown as it happens, not later. br Kusti From pietro.galassi at gmail.com Wed Jun 23 05:59:29 2010 From: pietro.galassi at gmail.com (Pietro Galassi) Date: Wed, 23 Jun 2010 13:59:29 +0200 Subject: [Rxtx] Resource temporarily unavaible on writeByte() Message-ID: Hi, i have successfully installe RXTX 64bit version from UBUNTO repository. I wrote a simple test program and it shows i have 3 ports avaible on my system: /dev/ttyS1 - Serial /dev/ttyS0 - Serial /dev/lp0 - Parallel but as soon as i try to "writeByte" any data on the parallel port it always gives me: java.io.IOException: Resource temporarily unavaible on writeByte() My simple code is: ... outputStream = parallelPort.getOutputStream() ; System.out.println("Write..."); outputStream.write(88); outputStream.flush(); outputStream.close(); ... int mode = parallelPort.getMode(); gives always 0. Anyone can help pls ? Thanks a lot, Pietro Galassi -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Jun 23 10:35:37 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 18:35:37 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: <20100623163536.GI20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 12:55 +0300: > > Wouldn't it be better to store the exception in a member and > > throw it when needing Zystem (e.g. in new or open) > > I'm of the fail-fast school of thought so I think it should be > reported and re-thrown as it happens, not later. Ahh yes, I agree, in general it is much better to fail quick, loud and verbosely, right! However, if this is a static { } block, AFAIK it is not defined when it will be executed (Before application start? Or later, when loading the class later? Or when using it first time?). If the exception would be thrown before main() is called, I think it is difficult to catch it. I think some general global hook must be used to do so. Simpler to handle, if it is thrown when invocating some function, then it can be caught by try { } catch. (or am I wrong or outdated?) 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 rbreznak at neuronrobotics.com Wed Jun 23 11:46:21 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Wed, 23 Jun 2010 13:46:21 -0400 Subject: [Rxtx] Bundling native libraries Message-ID: Hello, I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. Has anyone had experience in doing this? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Wed Jun 23 18:26:17 2010 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 23 Jun 2010 17:26:17 -0700 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Whoops, forgot to copy this to the RXTX list ... ---------- Forwarded message ---------- From: Brian Schlining Date: Wed, Jun 23, 2010 at 11:11 Subject: Re: [Rxtx] Bundling native libraries To: "Breznak, Robert" Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a > one jar. Its to the point where I have an Ant script that pulls all of the > jars together, but I haven't been able to get the native libraries to work; > They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the > user to get and use. They don't need to worry about external dependencies > and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 24 00:37:35 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 24 Jun 2010 08:37:35 +0200 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Here is a snippet from my ant file. I actually unjar the rxtx jar file and add my own classes to it for Mac and WIndows. The snippet below is actually for Mac but just for your info I am using nsis and launch4j to create an exectuable for windows. I also copy the rxtx libs to the root folder of my application: On 24.06.2010, at 02:26, Brian Schlining wrote: > Whoops, forgot to copy this to the RXTX list ... > > ---------- Forwarded message ---------- > From: Brian Schlining > Date: Wed, Jun 23, 2010 at 11:11 > Subject: Re: [Rxtx] Bundling native libraries > To: "Breznak, Robert" > > > Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc > > On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 11:29:21 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 12:29:21 -0500 Subject: [Rxtx] Port to RS422? Message-ID: Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jun 24 12:18:10 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:18:10 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Thu Jun 24 12:22:15 2010 From: showard314 at gmail.com (Scott Howard) Date: Thu, 24 Jun 2010 14:22:15 -0400 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, On Thu, Jun 24, 2010 at 1:29 PM, James, David (DJ) (SA-1) wrote: > Has anyone tried porting RxTx to RS422? Don't know for sure but . . . > If not, where is all the C code for the other implementations so that I can > give it a shot? http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code There is a file called "PORTING" in the root of rxtx-devel Also refer to the (outdated) information on: http://users.frii.com/jarvi/rxtx/porting.html which has similar information to the PORTING file (trust the PORTING file in case of conflicts) I attached a copy of that file from the 2.2pre2 release to this email. Also, see the "toy box" section: http://rxtx.qbang.org/wiki/index.php/Download for compiled downloads on other platforms good luck. ~Scott -------------- next part -------------- A non-text attachment was scrubbed... Name: PORTING Type: application/octet-stream Size: 5017 bytes Desc: not available URL: From djjames at drs-ssi.com Thu Jun 24 12:22:52 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 13:22:52 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ 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 Jun 24 12:39:42 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:39:42 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 14:10:41 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 15:10:41 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: I agree with the RS422/RS485/RS232 control side being the same. Everything I have read says that this should be so. I did notice that there is a RS485 implementation within RxTx that RS485Port.java states is "Non functional". I was thinking that I could/should use the RS485 code as a basis for the RS422 code, if necessary. But this seems a rash course of action if it doesn't function. I am then trying to debug 2 sets of code, instead of working from a good set to get my "bad" set to work correctly. 1) I don't understand the first question "does your RS422 is voltage interface to RS232?" What is "is voltage"? What is an "is voltage interface"? I apologize for my ignorance about this. I have a "true" RS422 port, +/- 5 volt differential if that is what you mean. There is no cross talk between the RS232 and RS422 that I can detect. I know that the RS422 port works, from the command line I have copied a file to that tty device and see voltage changes on my scope on the transmit+ and transmit- pins. 2) No USB dongles are involved in the "badness". That said, as a test, I have run the target java code on a laptop with a USB to serial dongle and a RS232 to RS422 converter hooked to my RS422 source and the serial communications is great. I know that my messaging code is parsing the messages and that the RxTx RS232 code is getting the correct interrupts for the raw data to build the messages up from the raw data. 3) See 2). When I enumerate the ports on my Linux machine, the RS422 port shows up as a serial port. portList = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier foundPortId = null; while (portList.hasMoreElements()) { portId = (gnu.io.CommPortIdentifier) portList.nextElement(); int portType = portId.getPortType(); System.out.println("Found port " + portId.getName()); System.out.println(" of port type " + portId.getPortType()); if (portType == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { portFound = true; foundPortId = portId; } } } I hope this is the information that you requested. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:40 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Thu Jun 24 16:25:11 2010 From: jredman at ergotech.com (Jim Redman) Date: Thu, 24 Jun 2010 16:25:11 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C23DB47.5070308@ergotech.com> RS485 has a 2-wire, half-duplex mode. In this case you need a mechanism to switch sender and receiver. In many cases, the RS485 port will do this for you. Most RS232<->RS485 converters will also manage the switching in a way that is totally transparent to you. In principle, if you don't have a port that handles switching automatically for you, you could control this switching in software. Realistically, unless you have a long delay between sending and reply generation, say 100ms or more, it would be difficult. With most system, the response comes back very quickly and user level code will be too slow to manage that. I think that RS422 is always 4-wire. From the software standpoint, it, and 4-wire RS422 (and current loop and ...) all look the same. There are some electrical issues with RS422 and RS485 particularly termination. I haven't hooked up 485 or 422 in a while so I don't remember all the details, but if you get it wrong it probably won't work. Jim On 06/24/2010 12:39 PM, Mariusz Dec wrote: > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, > I have a 232 port and everything is wonderful. I set the 422 port > up similarly and see no events firing (except output buffer empty). > I set up a scope on the connector and copy a file to the port > (/dev/ttyS1 in my case) and see output. I do the same through RxTx > and see nothing. If this is a setup problem, I am confused as I set > the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so > that I can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From mariusz.dec at gmail.com Fri Jun 25 01:52:48 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Fri, 25 Jun 2010 09:52:48 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, now you are sleeping and I have the next day :) So - "voltage interface" means that you have RS232 interface and voltage level converter to use it as RS422. In such case proper work of the RS232 determines proper work of the RS422 (if hw works). In case you make tests on physically different controllers, there may be a lot of traps more, especially now, when we have milions of USB/RS232 dongles vendors and milions of not-properly-working VCP-drivers. Your sentence: "dongle and a RS232 to RS422 converter hooked to" says that you have one RS232 controller and you are using "voltage interface" named >converter< to connect to external RS422 source. It means that only problem is somewhere on the physical part of the interface. If you are seeing signals on the scope, means that you may send dat ok. if you have checked that your USB-serial dongle works good with events, look for the hw mistakes (wiring etc). If you haven't yet checked if your USB-serial dongle works good with events read this: http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html AND always remember that USB-serial dongle isn't serial COM port, this is VIRTUAL Com Port. And this may make a big difference... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t function. > I am then trying to debug 2 sets of code, instead of working from a good set > to get my ?bad? set to work correctly. > > > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on the > transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is parsing > the messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up as > a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:40 PM > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't > the same ? > > Regards > Mariusz > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I have > a 232 port and everything is wonderful. I set the 422 port up similarly and > see no events firing (except output buffer empty). I set up a scope on the > connector and copy a file to the port (/dev/ttyS1 in my case) and see > output. I do the same through RxTx and see nothing. If this is a setup > problem, I am confused as I set the two ports up similarly. > > > > Thanks, > > DJ > > > > > > > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of actual > hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Fri Jun 25 01:54:39 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 25 Jun 2010 08:54:39 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: <4C23DB47.5070308@ergotech.com> References: <4C23DB47.5070308@ergotech.com> Message-ID: I'm happily using RXTX to communicate with RS422 devices in 4-wire mode using KK-Systems K2 RS232-RS422/RS485 converters (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). Running at 115200 baud -- no issues at all. Regards, Michael Erskine. From jredman at ergotech.com Fri Jun 25 11:29:10 2010 From: jredman at ergotech.com (Jim Redman) Date: Fri, 25 Jun 2010 11:29:10 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <4C23DB47.5070308@ergotech.com> Message-ID: <4C24E766.50102@ergotech.com> Note that the K2 doesn't do automatic switching for RS485, the K2-ADE does. For true RS422 this is irrelevant. We've used a bunch of converters, including some USB versions, some from B&B (http://www.bb-elec.com/) and some (a lot?) of the non-name, low cost RS232-RS485 converters that are out there. There really is no difference as far as the software is concerned. The cabling and termination of 485/422 do tend to be more problematic, and it's likely that the problem lies there rather than anywhere else. Jim On 06/25/2010 01:54 AM, Michael Erskine wrote: > I'm happily using RXTX to communicate with RS422 devices in 4-wire > mode using KK-Systems K2 RS232-RS422/RS485 converters > (http://www.kksystems.com/english/html_files/product_pages/k2_k2-ade.htm). > Running at 115200 baud -- no issues at all. > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From robohobby at gmail.com Sun Jun 27 07:41:33 2010 From: robohobby at gmail.com (Oleg Lyubchenko) Date: Sun, 27 Jun 2010 17:41:33 +0400 Subject: [Rxtx] Is it possible to receive data from serial port, using RXTX under Linux? Message-ID: Hi, I am trying to use RxTx for a simple project. Small board ETX should communicate with several devices, using serial ports. The application should work under Linux. Java is my favorite language and that was the reason, why RXTX was selected for the task. Under Windows all was OK. But under Linux I see strange thing - It is possible to send data to the port, but it is impossible to read data from port under Linux. Lock files are OK - this part work as it should. User (the user is 'root') has permissions to read-write to port (to device). Kermit and minicom works fine with the modem. The application can send data, but can not read data. As a test example I use standard example class - TwoWaySerialComm.java . I tried both versions of this file - one version without Events and version with Events. I see the same picture with Puppy Linux, with Ubuntu 9.10, OpenSuSE 11. As a hardware I use ETX board and notebook Samsung R40. Both platforms shows the same result - can write to port, can not read from port. What I mean by "send and receive data": I do very simple test - after connection to the device I type "atz" and waiting for the answer from the modem. Normal answer should be "OK". Under Windows, using "TwoWaySerialComm" I see : ATZ ATZ OK Under Linux I see only ATZ ATZ (No normal answer 'OK') Any ideas? PS: If you want to see the code, you can download the code of the project from http://www.robohobby.com/downloads/JavaRxTx.zip There is nothing special there - just project for Netbeans with code of two standard examples. to run it under Windows, use JavaRxTx\r.bat for Linux, use JavaRxTx\sh r.sh Sincerely, Oleg -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at iDIAcomputing.com Sun Jun 27 08:16:25 2010 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 27 Jun 2010 10:16:25 -0400 Subject: [Rxtx] Is it possible to receive data from serial port, using RXTX under Linux? In-Reply-To: References: Message-ID: <4C275D39.3060005@iDIAcomputing.com> Oleg On 6/27/10 9:41 AM, Oleg Lyubchenko wrote: > Under Windows, using "TwoWaySerialComm" I see : > ATZ > ATZ > OK > > Under Linux > I see only > ATZ > ATZ > > (No normal answer 'OK') > > Any ideas? > > PS: If you want to see the code, you can download the code of the > project from > http://www.robohobby.com/downloads/JavaRxTx.zip > There is nothing special there - just project for Netbeans with code of > two standard examples. > > to run it under Windows, use > JavaRxTx\r.bat > for Linux, use JavaRxTx\sh r.sh Oleg, I've not looked at your code, but are you sending both a carriage return and a linefeed to the modem? Windows will generally send both for a \n but Linux will generally only send a linefeed. You may need to use \r\n to get both. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From djjames at drs-ssi.com Mon Jun 28 07:40:32 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Mon, 28 Jun 2010 08:40:32 -0500 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: All, I have a box that has RS422 native, the sender of some data. I have another box that has RS422 native. My software runs on this machine. This is where my problem lies. I think I confused the issue with my statement about the 422/232 converter. I have the converter in my test setup to make certain that the sender was sending what I expected, hooked to a laptop with hyperterm. The production setup will have no converters. It cannot have a converter. I have another box on which I have to communicate via RS232. I have that communications up and running. I get the correct information out of my RS232 link. +------+ RS422 +----+ RS232 +-------+ |Sender|-------| Me |-------|Another| +------+ +----+ | Sender| +-------+ On the scope, I have verified that the RS422 sender is setting the transmit lines correctly. I cannot get my side of the RS422 communications to work. I have set my RS422 configuration to be similar to the RS232 that does work. The only event that I am getting is output buffer empty, even though I have turned off that notification (422port.notifyOnOutputEmpty(false);). I have 422port.notifyOnDataAvilable(true), yet I never get that event. It doesn't seem that I have things setup correctly. I have configured the RS422 port per my interface spec with the RS422 sender, yet I don't get any data (no data available events!). If I can't get this to work, I will be writing my own (which isn't a nice thought). From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Friday, June 25, 2010 2:53 AM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, now you are sleeping and I have the next day :) So - "voltage interface" means that you have RS232 interface and voltage level converter to use it as RS422. In such case proper work of the RS232 determines proper work of the RS422 (if hw works). In case you make tests on physically different controllers, there may be a lot of traps more, especially now, when we have milions of USB/RS232 dongles vendors and milions of not-properly-working VCP-drivers. Your sentence: "dongle and a RS232 to RS422 converter hooked to" says that you have one RS232 controller and you are using "voltage interface" named >converter< to connect to external RS422 source. It means that only problem is somewhere on the physical part of the interface. If you are seeing signals on the scope, means that you may send dat ok. if you have checked that your USB-serial dongle works good with events, look for the hw mistakes (wiring etc). If you haven't yet checked if your USB-serial dongle works good with events read this: http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html AND always remember that USB-serial dongle isn't serial COM port, this is VIRTUAL Com Port. And this may make a big difference... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I agree with the RS422/RS485/RS232 control side being the same. Everything I have read says that this should be so. I did notice that there is a RS485 implementation within RxTx that RS485Port.java states is "Non functional". I was thinking that I could/should use the RS485 code as a basis for the RS422 code, if necessary. But this seems a rash course of action if it doesn't function. I am then trying to debug 2 sets of code, instead of working from a good set to get my "bad" set to work correctly. 1) I don't understand the first question "does your RS422 is voltage interface to RS232?" What is "is voltage"? What is an "is voltage interface"? I apologize for my ignorance about this. I have a "true" RS422 port, +/- 5 volt differential if that is what you mean. There is no cross talk between the RS232 and RS422 that I can detect. I know that the RS422 port works, from the command line I have copied a file to that tty device and see voltage changes on my scope on the transmit+ and transmit- pins. 2) No USB dongles are involved in the "badness". That said, as a test, I have run the target java code on a laptop with a USB to serial dongle and a RS232 to RS422 converter hooked to my RS422 source and the serial communications is great. I know that my messaging code is parsing the messages and that the RxTx RS232 code is getting the correct interrupts for the raw data to build the messages up from the raw data. 3) See 2). When I enumerate the ports on my Linux machine, the RS422 port shows up as a serial port. portList = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier foundPortId = null; while (portList.hasMoreElements()) { portId = (gnu.io.CommPortIdentifier) portList.nextElement(); int portType = portId.getPortType(); System.out.println("Found port " + portId.getName()); System.out.println(" of port type " + portId.getPortType()); if (portType == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { portFound = true; foundPortId = portId; } } } I hope this is the information that you requested. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:40 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, If your RS422 differs from RS232 I can't help you. In my engneering history (about 30 years), from control side RS422/RS485/RS232 always were the same.... :) But without jokes - please describe - does your RS422 is voltage interface to RS232? - does your RS422 and RS232 are VCP port with USB dongle? - is there the same vendor of VCP driver if USB VCP dongles 422&232 aren't the same ? Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) I wish that this were the case, then I would be done! I am not seeing that 422 and 232 are the same. On my Linux machine, I have a 232 port and everything is wonderful. I set the 422 port up similarly and see no events firing (except output buffer empty). I set up a scope on the connector and copy a file to the port (/dev/ttyS1 in my case) and see output. I do the same through RxTx and see nothing. If this is a setup problem, I am confused as I set the two ports up similarly. Thanks, DJ From: Mariusz Dec [mailto:mariusz.dec at gmail.com] Sent: Thursday, June 24, 2010 1:18 PM To: James, David (DJ) (SA-1) Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Jun 28 08:18:08 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 28 Jun 2010 17:18:08 +0300 Subject: [Rxtx] Port to RS422? In-Reply-To: Message-ID: > If I can?t get this to work, I will be writing my own (which isn?t a nice > thought). As stated, from the software point of view RSxxx are identical (or if there is a critical difference lurking somewhere in the details, you are screwed), so I would think that if you roll your own you will run into a similar problem that you are having with rxtx, thus is makes sense to figure out first *what* is the problem here, and then see if you need to write your own. Just my 2 snt, but I've been there, done that. br Kusti From jredman at ergotech.com Mon Jun 28 12:32:38 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 28 Jun 2010 12:32:38 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C28EAC6.8030908@ergotech.com> RS422 is multi-drop. If you just want to monitor what is going on (for debugging or other reasons) connect the two native RS422 systems together (if you can test that these are working at this point so much the better) then add the RS422 converter to the same lines - no need for a pass through. So you'll have: | RS422 |-------------------| RS422 | | | [ RS422 Converter ] The converter will see all traffic and can talk on the line (but that might confuse the other two components. Jim On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From jredman at ergotech.com Mon Jun 28 12:43:57 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 28 Jun 2010 12:43:57 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <4C28ED6D.2040807@ergotech.com> Just out of interest, what's the make/model of RS422 converter you're using? On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From andy at g0poy.com Mon Jun 28 15:12:00 2010 From: andy at g0poy.com (Andy Eskelson) Date: Mon, 28 Jun 2010 22:12:00 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: <20100628221200.6ca3052d@workstation.site> Try TeraTerm rather than Hyperterm just in case that is the problem. http://www.ayera.com/teraterm/ I have known Hyperterm to do all sorts of things you don't tell it. (We gave up asking customers to use it) Sometimes it would receive OK, other times not. We never found out exactly what upset it. Generally we would be using it at 9600 8N1 so nothing special at all. After switching to TeraTerm we have no more problems. Andy On Mon, 28 Jun 2010 08:40:32 -0500 "James, David (DJ) (SA-1)" wrote: > All, > > > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > > > > > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > > > I cannot get my side of the RS422 communications to work. I have set > my RS422 configuration to be similar to the RS232 that does work. The > only event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn't seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don't get > any data (no data available events!). > > > > If I can't get this to work, I will be writing my own (which isn't a > nice thought). > > > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Friday, June 25, 2010 2:53 AM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and > voltage level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is "Non functional". I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn't > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my "bad" set to work correctly. > > > > 1) I don't understand the first question "does your RS422 is > voltage interface to RS232?" What is "is voltage"? What is an "is > voltage interface"? I apologize for my ignorance about this. > > > > I have a "true" RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the "badness". That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is > parsing the messages and that the RxTx RS232 code is getting the correct > interrupts for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:40 PM > > > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. > If this is a setup problem, I am confused as I set the two ports up > similarly. > > > > Thanks, > > DJ > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:18 PM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > From djjames at drs-ssi.com Mon Jun 28 15:28:24 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Mon, 28 Jun 2010 16:28:24 -0500 Subject: [Rxtx] RS422 converter model and (maybe) resolution. In-Reply-To: References: Message-ID: B&B Electronics 422PP9R. Things work great with it. It now appears to be the box. We were able to get another one in for testing and BlockBox is getting events as it should. He suggestion that it might be hardware was spot on. But (of course), you want to make certain that your stuff is working correctly before you accuse the other side of any wrong doing. Thanks for all the advice! DJ -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Monday, June 28, 2010 3:26 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 34, Issue 11 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. Re: Port to RS422? (Kustaa Nyholm) 2. Re: Port to RS422? (Jim Redman) 3. Re: Port to RS422? (Jim Redman) 4. Re: Port to RS422? (Andy Eskelson) ---------------------------------------------------------------------- Message: 1 Date: Mon, 28 Jun 2010 17:18:08 +0300 From: Kustaa Nyholm To: "rxtx at qbang.org" Subject: Re: [Rxtx] Port to RS422? Message-ID: Content-Type: text/plain; charset="iso-8859-1" > If I can?t get this to work, I will be writing my own (which isn?t a nice > thought). As stated, from the software point of view RSxxx are identical (or if there is a critical difference lurking somewhere in the details, you are screwed), so I would think that if you roll your own you will run into a similar problem that you are having with rxtx, thus is makes sense to figure out first *what* is the problem here, and then see if you need to write your own. Just my 2 snt, but I've been there, done that. br Kusti ------------------------------ Message: 2 Date: Mon, 28 Jun 2010 12:32:38 -0600 From: Jim Redman To: RXTX Developers and Users Subject: Re: [Rxtx] Port to RS422? Message-ID: <4C28EAC6.8030908 at ergotech.com> Content-Type: text/plain; charset=windows-1252; format=flowed RS422 is multi-drop. If you just want to monitor what is going on (for debugging or other reasons) connect the two native RS422 systems together (if you can test that these are working at this point so much the better) then add the RS422 converter to the same lines - no need for a pass through. So you'll have: | RS422 |-------------------| RS422 | | | [ RS422 Converter ] The converter will see all traffic and can talk on the line (but that might confuse the other two components. Jim On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com ------------------------------ Message: 3 Date: Mon, 28 Jun 2010 12:43:57 -0600 From: Jim Redman Cc: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Message-ID: <4C28ED6D.2040807 at ergotech.com> Content-Type: text/plain; charset=windows-1252; format=flowed Just out of interest, what's the make/model of RS422 converter you're using? On 06/28/2010 07:40 AM, James, David (DJ) (SA-1) wrote: > All, > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > I cannot get my side of the RS422 communications to work. I have set my > RS422 configuration to be similar to the RS232 that does work. The only > event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn?t seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don?t get > any data (no data available events!). > > If I can?t get this to work, I will be writing my own (which isn?t a > nice thought). > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com] > *Sent:* Friday, June 25, 2010 2:53 AM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and voltage > level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is ?Non functional?. I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn?t > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my ?bad? set to work correctly. > > 1) I don?t understand the first question ?does your RS422 is voltage > interface to RS232?? What is ?is voltage?? What is an ?is voltage > interface?? I apologize for my ignorance about this. > > I have a ?true? RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the ?badness?. That said, as a test, I > have run the target java code on a laptop with a USB to serial dongle > and a RS232 to RS422 converter hooked to my RS422 source and the serial > communications is great. I know that my messaging code is parsing the > messages and that the RxTx RS232 code is getting the correct interrupts > for the raw data to build the messages up from the raw data. > > 3) See 2). > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > I hope this is the information that you requested. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:40 PM > > > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > I wish that this were the case, then I would be done! > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. If > this is a setup problem, I am confused as I set the two ports up similarly. > > Thanks, > > DJ > > *From:* Mariusz Dec [mailto:mariusz.dec at gmail.com > ] > *Sent:* Thursday, June 24, 2010 1:18 PM > *To:* James, David (DJ) (SA-1) > *Cc:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Port to RS422? > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > -->> Google & Wiki have a tons of answers about differences.... > > Regards > > Mariusz > > > 2010/6/24 James, David (DJ) (SA-1) > > > Has anyone tried porting RxTx to RS422? > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > Thanks! > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com ------------------------------ Message: 4 Date: Mon, 28 Jun 2010 22:12:00 +0100 From: Andy Eskelson To: rxtx at qbang.org Subject: Re: [Rxtx] Port to RS422? Message-ID: <20100628221200.6ca3052d at workstation.site> Content-Type: text/plain; charset=US-ASCII Try TeraTerm rather than Hyperterm just in case that is the problem. http://www.ayera.com/teraterm/ I have known Hyperterm to do all sorts of things you don't tell it. (We gave up asking customers to use it) Sometimes it would receive OK, other times not. We never found out exactly what upset it. Generally we would be using it at 9600 8N1 so nothing special at all. After switching to TeraTerm we have no more problems. Andy On Mon, 28 Jun 2010 08:40:32 -0500 "James, David (DJ) (SA-1)" wrote: > All, > > > > I have a box that has RS422 native, the sender of some data. I have > another box that has RS422 native. My software runs on this machine. > This is where my problem lies. I think I confused the issue with my > statement about the 422/232 converter. I have the converter in my test > setup to make certain that the sender was sending what I expected, > hooked to a laptop with hyperterm. The production setup will have no > converters. It cannot have a converter. I have another box on which I > have to communicate via RS232. I have that communications up and > running. I get the correct information out of my RS232 link. > > > > +------+ RS422 +----+ RS232 +-------+ > > |Sender|-------| Me |-------|Another| > > +------+ +----+ | Sender| > > +-------+ > > > > > > > On the scope, I have verified that the RS422 sender is setting the > transmit lines correctly. > > > > I cannot get my side of the RS422 communications to work. I have set > my RS422 configuration to be similar to the RS232 that does work. The > only event that I am getting is output buffer empty, even though I have > turned off that notification (422port.notifyOnOutputEmpty(false);). I > have 422port.notifyOnDataAvilable(true), yet I never get that event. It > doesn't seem that I have things setup correctly. I have configured the > RS422 port per my interface spec with the RS422 sender, yet I don't get > any data (no data available events!). > > > > If I can't get this to work, I will be writing my own (which isn't a > nice thought). > > > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Friday, June 25, 2010 2:53 AM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > now you are sleeping and I have the next day :) > > So - "voltage interface" means that you have RS232 interface and > voltage level converter to use it as RS422. > In such case proper work of the RS232 determines proper work of the > RS422 (if hw works). > > In case you make tests on physically different controllers, there may be > a lot of traps more, especially now, when we have milions of USB/RS232 > dongles vendors and milions of not-properly-working VCP-drivers. > > Your sentence: > "dongle and a RS232 to RS422 converter hooked to" > says that you have one RS232 controller and you are using "voltage > interface" named >converter< to connect to external RS422 source. > > It means that only problem is somewhere on the physical part of the > interface. > If you are seeing signals on the scope, means that you may send dat ok. > > if you have checked that your USB-serial dongle works good with events, > look for the hw mistakes (wiring etc). > If you haven't yet checked if your USB-serial dongle works good with > events read this: > > http://mailman.qbang.org/pipermail/rxtx/2010-June/6518443.html > > AND always remember that USB-serial dongle isn't serial COM port, this > is VIRTUAL Com Port. > And this may make a big difference... > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I agree with the RS422/RS485/RS232 control side being the same. > Everything I have read says that this should be so. > > > > I did notice that there is a RS485 implementation within RxTx that > RS485Port.java states is "Non functional". I was thinking that I > could/should use the RS485 code as a basis for the RS422 code, if > necessary. But this seems a rash course of action if it doesn't > function. I am then trying to debug 2 sets of code, instead of working > from a good set to get my "bad" set to work correctly. > > > > 1) I don't understand the first question "does your RS422 is > voltage interface to RS232?" What is "is voltage"? What is an "is > voltage interface"? I apologize for my ignorance about this. > > > > I have a "true" RS422 port, +/- 5 volt differential if that is what you > mean. There is no cross talk between the RS232 and RS422 that I can > detect. I know that the RS422 port works, from the command line I have > copied a file to that tty device and see voltage changes on my scope on > the transmit+ and transmit- pins. > > 2) No USB dongles are involved in the "badness". That said, as a > test, I have run the target java code on a laptop with a USB to serial > dongle and a RS232 to RS422 converter hooked to my RS422 source and the > serial communications is great. I know that my messaging code is > parsing the messages and that the RxTx RS232 code is getting the correct > interrupts for the raw data to build the messages up from the raw data. > > 3) See 2). > > > > When I enumerate the ports on my Linux machine, the RS422 port shows up > as a serial port. > > > > > > portList = CommPortIdentifier.getPortIdentifiers(); > > CommPortIdentifier foundPortId = null; > > while (portList.hasMoreElements()) { > > portId = (gnu.io.CommPortIdentifier) portList.nextElement(); > > int portType = portId.getPortType(); > > System.out.println("Found port " + portId.getName()); > > System.out.println(" of port type " + portId.getPortType()); > > > > if (portType == CommPortIdentifier.PORT_SERIAL) { > > if (portId.getName().equals(defaultPort)) { > > portFound = true; > > foundPortId = portId; > > } > > } > > } > > > > > > I hope this is the information that you requested. > > > > Thanks, > > DJ > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:40 PM > > > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > If your RS422 differs from RS232 I can't help you. > > In my engneering history (about 30 years), from control side > RS422/RS485/RS232 always were the same.... :) > > But without jokes - please describe > > - does your RS422 is voltage interface to RS232? > - does your RS422 and RS232 are VCP port with USB dongle? > - is there the same vendor of VCP driver if USB VCP dongles 422&232 > aren't the same ? > > Regards > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > I wish that this were the case, then I would be done! > > > > I am not seeing that 422 and 232 are the same. On my Linux machine, I > have a 232 port and everything is wonderful. I set the 422 port up > similarly and see no events firing (except output buffer empty). I set > up a scope on the connector and copy a file to the port (/dev/ttyS1 in > my case) and see output. I do the same through RxTx and see nothing. > If this is a setup problem, I am confused as I set the two ports up > similarly. > > > > Thanks, > > DJ > > > > > > > > From: Mariusz Dec [mailto:mariusz.dec at gmail.com] > Sent: Thursday, June 24, 2010 1:18 PM > To: James, David (DJ) (SA-1) > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port to RS422? > > > > Hi, > > RXTX of course works. > > RS422, RS485 differs from RS232 on hardware level only. > > So, because RXTX works with RS232 will works wit RS422 as well. > > Only difference is that RS422 may will be faster - but it depends of > actual hardware. RXTX allows using any speed available in driver/hw. > > > > -->> Google & Wiki have a tons of answers about differences.... > > > > Regards > > Mariusz > > > > > 2010/6/24 James, David (DJ) (SA-1) > > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I > can give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > > _______________________________________________ > 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 End of Rxtx Digest, Vol 34, Issue 11 ************************************ From msemtd at googlemail.com Tue Jun 29 04:05:10 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 29 Jun 2010 11:05:10 +0100 Subject: [Rxtx] Port to RS422? In-Reply-To: <20100628221200.6ca3052d@workstation.site> References: <20100628221200.6ca3052d@workstation.site> Message-ID: On 28 June 2010 22:12, Andy Eskelson wrote: > Try TeraTerm rather than Hyperterm just in case that is the problem. > http://www.ayera.com/teraterm/ I recommend RealTerm over teraterm pro (proper FOSS licence, you get the source code, actively maintained, etc.): http://realterm.sourceforge.net/ Regards, Michael Erskine. From mariusz.dec at gmail.com Tue Jun 29 04:37:25 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 29 Jun 2010 12:37:25 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <20100628221200.6ca3052d@workstation.site> Message-ID: Hi, a bit from my experience :). I am using my own terminals only. Why? Because good transmission practice says that in data packet should be a header, trailer, checksum, block length etc. My terminals (software like Hyperterm) for each project have a simple current protocols parsers and shows important data in clear form. Additionally I can see whole time of the developing that second side of the transmission path works good as well (for example - good checksum arrives). Currently I am receiving /sendign quite large packets - about 50 bytes - how to look inside without tools? This is easy to write ad-hoc specialized terminal and this helps a lot :). Regards Mariusz 2010/6/29 Michael Erskine > On 28 June 2010 22:12, Andy Eskelson wrote: > > Try TeraTerm rather than Hyperterm just in case that is the problem. > > http://www.ayera.com/teraterm/ > > I recommend RealTerm over teraterm pro (proper FOSS licence, you get > the source code, actively maintained, etc.): > http://realterm.sourceforge.net/ > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Tue Jun 29 08:23:24 2010 From: jredman at ergotech.com (Jim Redman) Date: Tue, 29 Jun 2010 08:23:24 -0600 Subject: [Rxtx] Port to RS422? In-Reply-To: References: <20100628221200.6ca3052d@workstation.site> Message-ID: <4C2A01DC.50200@ergotech.com> If you're on Windows and just trying to snoop the communications, then the Sysinternals "PortMon" can be useful: http://technet.microsoft.com/en-us/sysinternals/bb795533.aspx It looks as though RealTerm might have a similar feature. Jim On 06/29/2010 04:37 AM, Mariusz Dec wrote: > Hi, > a bit from my experience :). > > I am using my own terminals only. > Why? > Because good transmission practice says that in data packet should be a > header, trailer, checksum, block length etc. > My terminals (software like Hyperterm) for each project have a simple > current protocols parsers and shows important data in clear form. > Additionally I can see whole time of the developing that second side of > the transmission path works good as well (for example - good checksum > arrives). > Currently I am receiving /sendign quite large packets - about 50 bytes - > how to look inside without tools? > > This is easy to write ad-hoc specialized terminal and this helps a lot :). > > Regards > Mariusz > > > > 2010/6/29 Michael Erskine > > > On 28 June 2010 22:12, Andy Eskelson > wrote: > > Try TeraTerm rather than Hyperterm just in case that is the problem. > > http://www.ayera.com/teraterm/ > > I recommend RealTerm over teraterm pro (proper FOSS licence, you get > the source code, actively maintained, etc.): > http://realterm.sourceforge.net/ > > Regards, > Michael Erskine. > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From mariusz.dec at gmail.com Tue Jun 29 09:13:32 2010 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Tue, 29 Jun 2010 17:13:32 +0200 Subject: [Rxtx] Port to RS422? References: <20100628221200.6ca3052d@workstation.site> <4C2A01DC.50200@ergotech.com> Message-ID: <260B5D1534CF44FF92AC19D9B016F177@mdam2> Hi, sysinternals has a lot of very usefull tools :). But in my projects binary data isn't enough when I receive some analog data from DAC's. This is voltage but as representation of temperature, pressure, voltage.... Easiest way is to do own terminal with simple parser. Now in the era of the USB/RS232 dongles another usefull tool is "just connected COM port finder"... I did it and work is comfortable - no more system crashes when disconecting USB while terminal is working. The most difficult was the first step after fight with Hyperterm few years ago... :) Regards :) Mariusz ----- Original Message ----- From: "Jim Redman" Cc: Sent: Tuesday, June 29, 2010 4:23 PM Subject: Re: [Rxtx] Port to RS422? > If you're on Windows and just trying to snoop the communications, then > the Sysinternals "PortMon" can be useful: > > http://technet.microsoft.com/en-us/sysinternals/bb795533.aspx > > It looks as though RealTerm might have a similar feature. > > Jim > > On 06/29/2010 04:37 AM, Mariusz Dec wrote: >> Hi, >> a bit from my experience :). >> >> I am using my own terminals only. >> Why? >> Because good transmission practice says that in data packet should be a >> header, trailer, checksum, block length etc. >> My terminals (software like Hyperterm) for each project have a simple >> current protocols parsers and shows important data in clear form. >> Additionally I can see whole time of the developing that second side of >> the transmission path works good as well (for example - good checksum >> arrives). >> Currently I am receiving /sendign quite large packets - about 50 bytes - >> how to look inside without tools? >> >> This is easy to write ad-hoc specialized terminal and this helps a lot :). >> >> Regards >> Mariusz >> >> >> >> 2010/6/29 Michael Erskine > > >> >> On 28 June 2010 22:12, Andy Eskelson > > wrote: >> > Try TeraTerm rather than Hyperterm just in case that is the problem. >> > http://www.ayera.com/teraterm/ >> >> I recommend RealTerm over teraterm pro (proper FOSS licence, you get >> the source code, actively maintained, etc.): >> http://realterm.sourceforge.net/ >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> 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 > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From andrea.antonello at gmail.com Tue Jun 29 14:39:49 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Tue, 29 Jun 2010 22:39:49 +0200 Subject: [Rxtx] wrapping rxtx in eclipse Message-ID: Hi developers, I am currently using rxtx in an eclipse based GIS project to connect to GPS via bluetooth. I found the http://rxtx.qbang.org/wiki/index.php/Wrapping_RXTX_in_an_Eclipse_Plugin page a great start to maintain platform "independency". We are currently working on eclipse 3.6 and created the rxtx plugins as they suggest to do them now using plugins and fragments. Currently the namespace of the plugin is ours with authors rxtx.org. I was thinking it probably would make more sense to create them with the rxtx namespace and make them downloadable here? So finally the question: - is it ok if I update the above wiki page with eclipse 3.6 instructions? - would there be interst for me maintaining the eclipse plugins for rxtx? - is it ok to add my project to the projects using rxtx? That's all, best regards, Andrea From karl.weber99 at gmx.net Wed Jun 30 03:17:26 2010 From: karl.weber99 at gmx.net (Karl Weber) Date: Wed, 30 Jun 2010 11:17:26 +0200 Subject: [Rxtx] wrapping rxtx in eclipse In-Reply-To: References: Message-ID: <201006301117.26265.karl.weber99@gmx.net> Am Dienstag, 29. Juni 2010 22:39 schrieb andrea antonello: > Hi developers, > I am currently using rxtx in an eclipse based GIS project to connect > to GPS via bluetooth. > I found the > http://rxtx.qbang.org/wiki/index.php/Wrapping_RXTX_in_an_Eclipse_Plugin > page a great start to maintain platform "independency". > > We are currently working on eclipse 3.6 and created the rxtx plugins > as they suggest to do them now using plugins and fragments. > Currently the namespace of the plugin is ours with authors rxtx.org. I > was thinking it probably would make more sense to create them with the > rxtx namespace and make them downloadable here? > So finally the question: > - is it ok if I update the above wiki page with eclipse 3.6 instructions? > - would there be interst for me maintaining the eclipse plugins for rxtx? > - is it ok to add my project to the projects using rxtx? > I am no OSGi expert, but if you think about maintaining an eclipse-plugin for rxtx, I would suggest a better solution, which should work, as far as I understand OSGi: (1) Create an OSGi-bundle. What I mean here is, that one should not use any eclipse / equinox specific stuff, so that this bundle can be used with other OSGi-frameworks as well. (2) Do not create a wrapper. If only java-classes where involved, the difference between an OSGi-Bundle and an ordinary jar-file was only some entries in the MANIFEST-header. So, instead of heaving a jar within a jar, I would prefer to have only one jar that is an OSGi-Bundle. Such OSGi-Bundle can also be used outside of any OSGi-framework, as ordinary jar-file. That rxtx involves c-libraries should not make much difference. In addition to the java-classes the (single) jar should also contain the libs. It would also be nice, to enhance the rxtx build-service, such that it can create such OSGi-bundles from the sources. /Karl P.S. I am currently also using a wrapper plug-in, but I am not happy with this solution... From andrea.antonello at gmail.com Wed Jun 30 04:07:24 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Wed, 30 Jun 2010 12:07:24 +0200 Subject: [Rxtx] wrapping rxtx in eclipse In-Reply-To: <201006301117.26265.karl.weber99@gmx.net> References: <201006301117.26265.karl.weber99@gmx.net> Message-ID: Hi Karl, I think your suggestions are good. The problem is that I am also no Osgi specialist. I can ensure a continuity in maintainment and bugfixes only by proposing something I would do anyways, which is keeping up the plugins and fragments for my project. For something something different I am afraid that after few time it would get of low priority in my list of job tasks and I prefer to not take that path. Andrea On Wed, Jun 30, 2010 at 11:17 AM, Karl Weber wrote: > Am Dienstag, 29. Juni 2010 22:39 schrieb andrea antonello: >> Hi developers, >> I am currently using rxtx in an eclipse based GIS project to connect >> to GPS via bluetooth. >> I found the >> http://rxtx.qbang.org/wiki/index.php/Wrapping_RXTX_in_an_Eclipse_Plugin >> page a great start to maintain platform "independency". >> >> We are currently working on eclipse 3.6 and created the rxtx plugins >> as they suggest to do them now using plugins and fragments. >> Currently the namespace of the plugin is ours with authors rxtx.org. I >> was thinking it probably would make more sense to create them with the >> rxtx namespace and make them downloadable here? >> So finally the question: >> - is it ok if I update the above wiki page with eclipse 3.6 instructions? >> - would there be interst for me maintaining the eclipse plugins for rxtx? >> - is it ok to add my project to the projects using rxtx? >> > > I am no OSGi expert, but if you think about maintaining an eclipse-plugin for > rxtx, I would suggest a better solution, which should work, as far as I > understand OSGi: > > (1) Create an OSGi-bundle. What I mean here is, that one should not use any > eclipse / equinox specific stuff, so that this bundle can be used with other > OSGi-frameworks as well. > > (2) Do not create a wrapper. If only java-classes where involved, the > difference between an OSGi-Bundle and an ordinary jar-file was only some > entries in the MANIFEST-header. So, instead of heaving a jar within a jar, I > would prefer to have only one jar that is an OSGi-Bundle. Such OSGi-Bundle > can also be used outside of any OSGi-framework, as ordinary jar-file. > > That rxtx involves c-libraries should not make much difference. In addition to > the java-classes the (single) jar should also contain the libs. > > It would also be nice, to enhance the rxtx build-service, such that it can > create such OSGi-bundles from the sources. > > /Karl > > > P.S. I am currently also using a wrapper plug-in, but I am not happy with this > solution... > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wolverin00 at gmail.com Tue Jun 1 08:46:35 2010 From: wolverin00 at gmail.com (Mr. eduman Magoo) Date: Tue, 1 Jun 2010 16:46:35 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows Message-ID: Hi, i'm developing a java application (running on windows xp) to comunicate with a wireless sensor network coordinator (model: cc2530, producer: texas instruments) trough a serial port. I'm trying to write an event application, in particular when a data is ready to be read from the port a procedure have to be execute. This procedure works fine under linux, but under windows the same code and the same rxtx's version doesn't read anything. I don't understand why and what happen. I don't receive errors or exceptions, so i can't detect where is the problem. The writing procedure works fine in both OS. Can I have your help please? thanks a lot. I'm using the rxtx 2.1-7-bins-r2.zip package and eclipse, and this is the code that i wanna run on windows: // derived from SUN's examples in the javax.comm package import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class nulltest implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static CommPortIdentifier saveportId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } if (args.length > 0) { defaultPort = args[0]; } System.out.println("Set default port to "+defaultPort); // parse ports and if the default port is found, initialized the reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public void initwritetoport() { // initwritetoport() assumes that the port has already been opened and // initialized by "public nulltest()" try { // get the outputstream outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { // activate the OUTPUT_BUFFER_EMPTY notifier serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } } public void writetoport() { System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); try { // write string to serial port outputStream.write(messageString.getBytes()); } catch (IOException e) {} } public nulltest() { // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} // activate the DATA_AVAILABLE notifier serialPort.notifyOnDataAvailable(true); try { // set port parameters serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} // start the read thread readThread = new Thread(this); readThread.start(); } public void run() { // first thing in the thread, we initialize the write operation initwritetoport(); try { while (true) { // write string to port, the serialEvent will read it writetoport(); Thread.sleep(1000); } } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: // we get here if data has been received byte[] readBuffer = new byte[20]; try { // read data while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } // print data String result = new String(readBuffer); System.out.println("Read: "+result); } catch (IOException e) {} break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Jun 1 09:06:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Jun 2010 17:06:23 +0200 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: HI, 1. Try with 2.2 pre 2. In most cases PortInUse works only if RXTX is owner of the port. So this isn't good idea to check if port is available. Instead of this try open() and if Exception occurs, determine that this port is not available. 3. There is a lot of confguration parameters in RXTX which are NOT available in javax.com. So examples from javax.com are ..... not too good. 4. Look for RXTX configuration/samples. You find many here, on this list. Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From james at enrogen.com Tue Jun 1 13:34:02 2010 From: james at enrogen.com (James A R Brown) Date: Tue, 01 Jun 2010 20:34:02 +0100 Subject: [Rxtx] [Fwd: No ports listed, ack Permissions problem] Message-ID: <1275420842.2281.97.camel@localhost> Hi Trent, After compiling the Jar with debug on and running, it was clearly finding the ports and failing at "testport" native method. The problem I had here, was the silence. Eventually realising a chmod a +rwx /dev/ttyUSB0 sorted it. I missed this in the FAQ as I was really looking to list the ports, and not necessarily open them. I will amend udev rules later and do this properly ;) If I had just jumped in an tried to open the port, I would have realised this sooner. I have done some small changes to the Wiki to hopefully point out my own mistake and also point out ttyUSB is now covered without code ammendment in 2.2. I have not deleted the existing wiki instructions (just flagged them), will leave that upto yourself. So this had me thinking :- 1) Shouldn't the ports be listed, even if not available (talking about Linux.. don't know about Windows.) ? 2) If there are reasons, commportidentifier must have a testport check, could some form of println be generated?.. ie "ports found, none available.. check permissions etc" in the console. Anyway I am a happy man now. If you have a contributions scheme, let me know and I will see what I can sort as the project we are working on has a commercial backing. James From davestechshop at gmail.com Tue Jun 1 15:44:31 2010 From: davestechshop at gmail.com (Dave) Date: Tue, 1 Jun 2010 17:44:31 -0400 Subject: [Rxtx] how to disable lock files in 2.2pre2 on Linux? Message-ID: Hi, I'm trying to get the latest info as well as some newbie help. Looking here: http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_can_I_use_Lock_Files_with_rxtx.3F I see: *If you do not want to use lockfiles in RXTX, run 'configure' with option '--disable-lockfiles'.* Where do I run the configure option? It isn't clear if this is a command line instruction or something else. I'd like to call this option from within the java code if possible. Can anyone give a code example for disabling lock files? If there is a command line way to do this, I'd like to see that example too. Thanks. Regards, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Wed Jun 2 16:25:07 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 2 Jun 2010 23:25:07 +0100 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: References: Message-ID: On 1 June 2010 15:46, Mr. eduman Magoo wrote: > I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. Why on earth do you have empty exception handlers? It is no wonder that you have no idea what's happening. And again with the while loops within the event listener - do we need to ban people from using rxtx? Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Thu Jun 3 00:08:38 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 3 Jun 2010 09:08:38 +0300 Subject: [Rxtx] rxtx reading problems with serial port and windows In-Reply-To: Message-ID: > And again with the while loops within the event listener - do we need > to ban people from using rxtx? And what sort of loop! while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } If it loops all but the last read data is lost. Also based on the InputStream java doc and my own experience of various InputStreams it is not at all clear that the InputStream would not block if available() returned > 0 but < readBuffer.length. available() doc says that the read will not block for the returned number of bytes, but here he is trying to read 20 bytes regardless and the read(byte[] b) doc is not very explicit what should happen in a case like that. It hints ('method blocks until input data is available') that it may return if no more than one byte is available at the call time, but this is not very clear. br Kusti From vinzenz.weber at techforce.at Thu Jun 3 03:20:06 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 11:20:06 +0200 Subject: [Rxtx] Compile Win64 Message-ID: Hi list, I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > cvs checkout -r commapi-0-0-1 rxtx-devel which I assume has the latest changes and is the most uptodate repository for rxtx? How can I build for Win64 on my Vista 32 machine? Regards, Vinzenz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Thu Jun 3 05:22:54 2010 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 03 Jun 2010 15:22:54 +0400 Subject: [Rxtx] =?koi8-r?b?Q29tcGlsZSBXaW42NA==?= In-Reply-To: References: Message-ID: Hi! Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > Hi list, > > > > I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. > > > > > I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using > > > cvs checkout -r commapi-0-0-1 rxtx-devel > > which I assume has the latest changes and is the most up to date repository for rxtx? > > > > > How can I build for Win64 on my Vista 32 machine? > > > > > Regards, > > Vinzenz From vinzenz.weber at techforce.at Thu Jun 3 09:17:17 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 17:17:17 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: Message-ID: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Thanks Ivan, I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? Vinzenz On 03.06.2010, at 13:22, Ivan Maidanski wrote: > Hi! > > Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html > > Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : > >> Hi list, >> >> >> >> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >> >> >> >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >> >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> >> which I assume has the latest changes and is the most up to date repository for rxtx? >> >> >> >> >> How can I build for Win64 on my Vista 32 machine? >> >> >> >> >> Regards, >> >> Vinzenz From cppgent0 at gmail.com Thu Jun 3 10:15:55 2010 From: cppgent0 at gmail.com (J Arrizza) Date: Thu, 3 Jun 2010 09:15:55 -0700 Subject: [Rxtx] Rxtx Digest, Vol 34, Issue 1 In-Reply-To: References: Message-ID: > > > 1. rxtx reading problems with serial port and windows > (Mr. eduman Magoo) > Hi, i'm developing a java application (running on windows xp) to comunicate > with a wireless sensor network coordinator (model: cc2530, producer: texas > instruments) trough a serial port. I'm trying to write an event > application, > in particular when a data is ready to be read from the port a procedure > have > to be execute. This procedure works fine under linux, but under windows the > same code and the same rxtx's version doesn't read anything. I don't > understand why and what happen. I don't receive errors or exceptions, so i > can't detect where is the problem. > The writing procedure works fine in both OS. > Can I have your help please? > > I believe I had the same problem, or perhaps a variant of yours. The system worked very well on a Linux Ubuntu 9.1. Both tx and rx (115.2K 8E1) worked great for long periods of time (>9 hours up). Tried to get it to work in windows (using a USB-DB9 adapter) and would not work. Send worked ok, but nothing on the rx side. Used Hyperterm to talk to the other side from the winxp box and it worked fine, but using RXTX would not go. Searched the net, I saw one line in one note on a forum suggesting adding hardware control. I added it and voila it now works fine on both Linux and Windows (XP SP 2). Here is the code I had to add (just after the setSerialPortParams() call): try { //The following HW flowcontrol is needed for windows but not ubuntu mSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); } catch (UnsupportedCommOperationException ex) { System.err.println(ex.getMessage()); } I checked Hyperterm again with and without HW Flow control and it works ok either way. In any case, this solution might work for you. PS. just out of curiosity could anyone explain why this solution works? the sending side does not use flow control, and Hyperterm doesn't seem to require it, so it shouldn't make any difference and yet it does... John -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 3 10:30:25 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 3 Jun 2010 18:30:25 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> Message-ID: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Hey, You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? 1) I downloaded mingw-w64 from sourceforge: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download 2) By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME="C:\Program Files\Java\jdk1.6.0_20" #path to mingw32 #MINGHOME="C:\MinGW" MINGHOME="C:\mingw64" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" # path to install the shared libraries DOS style path LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path #LIBDIR="$(MINGHOME)\lib" # path to the junit library. Only needed for running the tests. JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" ###################### # End of user defined variables ###################### CC=x86_64-w64-mingw32-gcc #CC=gcc CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall 3) I am running mingw32-make to compile ... On 03.06.2010, at 18:18, Ivan Maidanski wrote: > Hi, Vinzenz! > > Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. > > What are the difficulties you have with mingw-w64? > > So, it would be nice if you prepare the patch ;). > > Regards. > > Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : > >> Thanks Ivan, >> >> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >> >> Vinzenz >> >> >> >> >> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >> >>> Hi! >>> >>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>> >>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>> >>>> Hi list, >>>> >>>> >>>> >>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>> >>>> >>>> >>>> >>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>> >>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>> >>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>> >>>> >>>> >>>> >>>> How can I build for Win64 on my Vista 32 machine? >>>> >>>> >>>> >>>> >>>> Regards, >>>> >>>> Vinzenz >> From pfaffmaj at lafayette.edu Thu Jun 3 12:31:46 2010 From: pfaffmaj at lafayette.edu (Jeffrey Pfaffmann) Date: Thu, 3 Jun 2010 14:31:46 -0400 Subject: [Rxtx] Delay in linking from a dongle to one of multiple bluetooth receivers. Message-ID: Hi there, I am assuming the following is a design feature for RS-232 that is causing problems in a bluetooth/RS-232 bridge situation. The setup is this. I have multiple linux machines with bluetooth dongles, and several robots with bluesmirf bluetooth to RS-232 links. When one of my machines attempts to link to a robot, it will _slowly_ query each bluetooth link that is out there. Then finally link to the bluetooth module that is should be linking to. In the end it will connect, but can take several minutes. 1. Do you think this is RXTX? 2. Is there a way for the system to link the first time it detects the correct bluetooth receiver? 3. Is there a way to speedup the detection process? 4. If I as to hack RXTX for my purposes, where might I find the negotiation protocol? Thanks in advanced. Jeff. From rbreznak at neuronrobotics.com Thu Jun 3 21:14:26 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Thu, 3 Jun 2010 23:14:26 -0400 Subject: [Rxtx] Windows Vista/ 7 Driver Issue Message-ID: This is not directly related to RxTx, but it seems like a reasonable place to ask a question anyways. I have a custom built PCB that has a PIC32 with a USB serial stack on it. In osx/linux/windows xp, it comes up as a serial port and is fine. With XP we needed to use the PIC INF file for Windows to properly use the device. With Windows 7 and Vista, unplugging the device, then plugging in a second copy (both have a unique usb id xxxx_01 and xxxx_02), cause the both devices to stop communicating with the computer and windows seems to find the driver to be corrupt. Either device then plugged into a Mac, Linux or XP box works without issue but will still not come up in 7/Vista. Any ideas as to why this might be happening? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreithomaz at gmail.com Sat Jun 5 15:59:22 2010 From: andreithomaz at gmail.com (Andrei Thomaz) Date: Sat, 5 Jun 2010 18:59:22 -0300 Subject: [Rxtx] working with Bluetooth devices and unstable connections Message-ID: dear users of rxtx, I am writing a Java application that shoud control 5 Arduino Bluetooth boards. I am being able to to this, using RXTX, but I am trying to find a reliable way of dealing with the unstability of Bluetooth connections. What I want do be able to do is: - start the application and, if it can't find one of the boards, it remains trying to connect until to be successfull; - if a connection is lost, the port is closed and it tries to open it again. For now, I can only to do this for periods of time smaller than 30 seconds. If I take more time to turn on the boards, or to restablish the connection to them, I get errors like these: Trying to open the port COM12 later. gnu.io.PortInUseException: Unknown Application Trying to open port COM12. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Acesso negado. Trying to open the port COM24 later. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0xe9 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1278): N?o h? processo no outro extremo do pipe. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro expirou. Error 0x79 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): O tempo limite do sem?foro egnu.io.PortInUseException: Unknown Application Trying to open port COM24. I thought about two solutions to deal with the PortInUseExceptions: - find what changes should I do to the Java code; - shutdown the app and restart the computer; I can use a BAT to implement the last option, like this one (I am running the application on Windows XP): java -jar "Amoreiras\java\amoreiras\Amoreiras\dist\Amoreiras.jar" shutdown /r /t 1 I am planning to put the BAT on Initialize folder of Start menu, so the application will always run on start. If it finds some problem it can't solve, it will restart the computer and try again. The Java code I wrote is below. If you have some suggestion, please, feel free to answer. I really would like to receive some advice. thank you, andrei package amoreiras; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.OutputStream; import java.util.Enumeration; /** * Controls an Arduino board. * * @author Andrei Thomaz */ public class ControladorAmoreira extends Thread { private SerialPort _serialPort; private String _portName; private CommPortIdentifier _portId; private boolean _motor1; private boolean _motor2; private boolean _motor3; /** The output stream to the port */ private OutputStream _output; /** Milliseconds to block while waiting for port open */ private static final int TIME_OUT = 2000; /** Default bits per second for COM port. */ private static final int DATA_RATE = 115200; public ControladorAmoreira( String portName ) { super(portName); _portName = portName; _motor1 = false; _motor2 = false; _motor3 = false; _portId = null; _serialPort = null; } public void run() { byte[] command = new byte[1]; while (true) { _openPort(); try { command[0] = (_motor1 ? (byte)1 : (byte)0); if (_serialPort != null) { System.out.print("Port " + _portName + " available.\n"); _output = _serialPort.getOutputStream(); if (_output != null) { System.out.print("Port " + _portName + " available for writing.\n"); _output.write(command); } else { System.out.print("Port " + _portName + " not available for writing.\n"); close(); } } else { System.out.print("Port " + _portName + " not available.\n"); } } catch (IOException io) { System.out.print("Error in port " + _portName + ".\n"); // force the port to be open again close(); } try { sleep(500); } catch (InterruptedException ie) { } } } private void _openPort() { while (_portId == null) { System.out.print("Trying to find port " + _portName + ".\n"); Enumeration enumPortas = CommPortIdentifier.getPortIdentifiers(); // tries to open the door while (enumPortas.hasMoreElements()) { CommPortIdentifier idPortaAtual = (CommPortIdentifier) enumPortas.nextElement(); if (idPortaAtual.getName().equals(_portName)) { _portId = idPortaAtual; System.out.print("Port " + _portName + " found.\n"); break; } } if (_portId == null) { System.out.print("Trying to find port " + _portName + " later.\n"); try { Thread.sleep(500); } catch (InterruptedException e) { } } } while (_serialPort == null) { System.out.print("Trying to open port " + _portName + ".\n"); // when it is successful... try { _serialPort = (SerialPort) _portId.open(this.getClass().getName(), TIME_OUT); //_portaSerial. if (_serialPort != null) { System.out.print("Port " + _portName + " opened.\n"); // set port parameters _serialPort.setSerialPortParams(DATA_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); // open the streams } } catch (Exception e) { System.err.println(e.toString()); close(); //_portaSerial = null; try { System.out.print("Trying to open the port " + _portName + " later.\n"); Thread.sleep(3000); } catch (InterruptedException ie) { } } } } public void setState( boolean motor1, boolean motor2, boolean motor3 ) { _motor1 = motor1; _motor2 = motor2; _motor3 = motor3; } /** * This should be called when you stop using the port. * This will prevent port locking on platforms like Linux. */ public synchronized void close() { if (_serialPort != null) { _serialPort.close(); if (_output != null) { try { _output.close(); } catch (IOException io) { } _output = null; } _serialPort = null; _portId = null; } } public void finalize() { close(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Sun Jun 6 02:24:23 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Sun, 6 Jun 2010 10:24:23 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <1275783989.4c0aeb3542735@mail.namezero.com> References: <1275783989.4c0aeb3542735@mail.namezero.com> Message-ID: <54C48B56-3B24-4F6F-ABCA-0947F1794FD0@techforce.at> Hi Howardz, as long as your 64bit version works fine I would love to peak into it! You were probably using mingw-w64? Vinzenz On 06.06.2010, at 02:26, howardz.com at howardz.com wrote: > Hello Vinzenz, > > I build rxtx-2.2pre2 on Vista/32 using Netbeans, mingw, and the mingw that makes > 64bit while running on 32bit (forgot the exact name). > > If you are interested, I can send some of it to you. > > However, I have modified some of the rxtx code, and it uses another package now > to read the windows registry. > > Howard > HowardZ at howardz.com > >> Message: 1 >> Date: Thu, 3 Jun 2010 11:20:06 +0200 >> From: Vinzenz-Emanuel Weber >> To: rxtx at qbang.org >> Subject: [Rxtx] Compile Win64 >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi list, >> >> I experience crashes when using the win32 and win64 binaries from >> rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine >> for win32. >> >> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for >> Win32. I checked out using >>> cvs checkout -r commapi-0-0-1 rxtx-devel >> which I assume has the latest changes and is the most uptodate repository for >> rxtx? >> >> How can I build for Win64 on my Vista 32 machine? >> >> Regards, >> Vinzenz From vinzenz.weber at techforce.at Thu Jun 17 10:51:12 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 17 Jun 2010 18:51:12 +0200 Subject: [Rxtx] Compile Win64 In-Reply-To: <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> References: <9C614DC3-19ED-4FB1-A626-82D3F5C46ABE@techforce.at> <0623A9EA-C707-45DE-9AA4-CF948DB556B3@techforce.at> Message-ID: <937AF7B4-8DDA-4C63-9680-AD7CCDB9D32B@techforce.at> Hey list, is there still noone who knows how to build the latest source for 64 bit windows? Vinzenz On 03.06.2010, at 18:30, Vinzenz-Emanuel Weber wrote: > Hey, > > You just exactly named the problems I face here: redefinition errors for timespec and _error as well as pointer to int cast warnings. But someone already once provided 64 bit versions so there must be someone knowing exactly on how to compile for 64bit, no? > > 1) > > I downloaded mingw-w64 from sourceforge: > http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20100601.zip/download > > 2) > > By adding some compiler flags I get it to 'O_RDWR' undeclared. Based on Makefile.mingw32 I changed the following (some extracts): > > > > ###################### > # user defined variables > ###################### > > # path to the source code (directory with SerialImp.c) Unix style path > SRC=../src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > JDKHOME="C:\Program Files\Java\jdk1.6.0_20" > > #path to mingw32 > #MINGHOME="C:\MinGW" > MINGHOME="C:\mingw64" > > # path to install RXTXcomm.jar DOS style path > COMMINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\lib\ext" > > # path to install the shared libraries DOS style path > LIBINSTALL="C:\Program Files\Java\jdk1.6.0_20\jre\bin" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > #LIBDIR="$(MINGHOME)\lib" > > # path to the junit library. Only needed for running the tests. > JUNIT_JAR="D:\Apps\junit3.8.2\junit.jar" > > ###################### > # End of user defined variables > ###################### > > > CC=x86_64-w64-mingw32-gcc > #CC=gcc > > CLASSPATH=-classpath ".;C:\Program Files\Java\jdk1.6.0_20\lib\classes.zip" > > > CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN64 -DNO_OLDNAMES -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall > > > > 3) > > I am running mingw32-make to compile ... > > > > > > On 03.06.2010, at 18:18, Ivan Maidanski wrote: > >> Hi, Vinzenz! >> >> Yes there are problems with the compilation. E.g. I observe redefinition errors for timespec and _error. Also, there are ptr2int cast warnings. >> >> What are the difficulties you have with mingw-w64? >> >> So, it would be nice if you prepare the patch ;). >> >> Regards. >> >> Thu, 3 Jun 2010 17:17:17 +0200 Vinzenz-Emanuel Weber : >> >>> Thanks Ivan, >>> >>> I am trying to use mingw-w64 but have difficulties getting it to work. Could you get more precise on how to compile rxtx on win32host, targeting win64? >>> >>> Vinzenz >>> >>> >>> >>> >>> On 03.06.2010, at 13:22, Ivan Maidanski wrote: >>> >>>> Hi! >>>> >>>> Use mingw-w64: http://mailman.qbang.org/pipermail/rxtx/2009-November/5493762.html >>>> >>>> Thu, 3 Jun 2010 11:20:06 +0200 Vinzenz-Emanuel Weber : >>>> >>>>> Hi list, >>>>> >>>>> >>>>> >>>>> I experience crashes when using the win32 and win64 binaries from rxtx-2.2pre2-bins.zip, I therefore wanted to build from CVS which works fine for win32. >>>>> >>>>> >>>>> >>>>> >>>>> I am using mingw32 and an adapted Makefile.mingw32 to build rxtx from CVS for Win32. I checked out using >>>>> >>>>>> cvs checkout -r commapi-0-0-1 rxtx-devel >>>>> >>>>> which I assume has the latest changes and is the most up to date repository for rxtx? >>>>> >>>>> >>>>> >>>>> >>>>> How can I build for Win64 on my Vista 32 machine? >>>>> >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> Vinzenz >>> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at From leo.guimaraes at gmail.com Fri Jun 18 13:29:14 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Fri, 18 Jun 2010 15:29:14 -0400 Subject: [Rxtx] Virtual Port with RXTX Message-ID: Hello everybody, Please, im crazy trying to solve this problem: I created a virtual port in my server to receive data over the ethernet from a serial port in the client machine. Im using socat for that: In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: 192.168.102.41:54321 its working fine for me, accessing the virtual port via CuteCom or any terminal. But i can't access this port via RXTX. The getPortIdentifiers() method returns only the /dev/ttyS0 port. Please guys, could you help me about that? Thank you very much! Leandro Guimar?es -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Fri Jun 18 23:43:50 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Sat, 19 Jun 2010 07:43:50 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: Hi, In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave tcp: > 192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or any > terminal. But i can't access this port via RXTX. The getPortIdentifiers() > method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock Try to change name of the virtual port. I suppose you are using Linux, so: In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid prefixes for the Linux com ports. Add your prefix there or change your VCP name to match to any predefined prefix there. Regards Mariusz > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jredman at ergotech.com Sat Jun 19 08:03:06 2010 From: jredman at ergotech.com (Jim Redman) Date: Sat, 19 Jun 2010 08:03:06 -0600 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: Message-ID: <4C1CCE1A.90201@ergotech.com> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports so: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 or whatever you need for the virtual port. The ports will enumerate in the order give (I don't know whether this is a guaranteed behavior or just the way it happens to be). Jim On 06/18/2010 11:43 PM, Mariusz Dec wrote: > Hi, > > In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > tcp:192.168.102.41:54321 > > its working fine for me, accessing the virtual port via CuteCom or > any terminal. But i can't access this port via RXTX. The > getPortIdentifiers() method returns only the /dev/ttyS0 port. > > Please guys, could you help me about that? > > > In client machine: socat tcp-l:54321,reuseaddr,fork > file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > > Try to change name of the virtual port. > > I suppose you are using Linux, so: > > In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > prefixes for the Linux com ports. > Add your prefix there or change your VCP name to match to any predefined > prefix there. > > Regards > Mariusz > > > > Thank you very much! > Leandro Guimar?es > > > _______________________________________________ > 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 -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From leo.guimaraes at gmail.com Mon Jun 21 13:23:26 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 16:23:26 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: <4C1CCE1A.90201@ergotech.com> References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hello, Change my virtual port to ttySXX worked fine... But now, im having another problem... I dont know why, but the virtual port is never calling the SerialEvent in the SerialPortEventListenner... using the real Serial port, works fine. But it doesnt work with the virtual port... Somebody have an idea?? Pleasse! Thank you!! Leandro Guimar?es On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: > You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > so: > > > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > > or whatever you need for the virtual port. The ports will enumerate in the > order give (I don't know whether this is a guaranteed behavior or just the > way it happens to be). > > Jim > > > > > On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> Hi, >> >> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave >> tcp:192.168.102.41:54321 >> >> >> its working fine for me, accessing the virtual port via CuteCom or >> any terminal. But i can't access this port via RXTX. The >> getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >> Please guys, could you help me about that? >> >> >> In client machine: socat tcp-l:54321,reuseaddr,fork >> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >> Try to change name of the virtual port. >> >> I suppose you are using Linux, so: >> >> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> prefixes for the Linux com ports. >> Add your prefix there or change your VCP name to match to any predefined >> prefix there. >> >> Regards >> Mariusz >> >> >> >> Thank you very much! >> Leandro Guimar?es >> >> >> _______________________________________________ >> 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 >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > > _______________________________________________ > 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 Mon Jun 21 13:47:13 2010 From: george.dma at gmail.com (George H) Date: Mon, 21 Jun 2010 19:47:13 +0000 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, This might be because it is a virtual port. I used to do testing on usb/serial port and there were some "signals" it would not send me that a real serial port would. Try to see what signals your serial port sends you that the virtual port doesn't. I think there are some serial port sniffers out there where you can intercept the signals. Also would do good if you look at some technical tutorials on how serial port signals work. A good site which I read over many times to try to understand why things are the way they are is http://www.arcelect.com/rs232.htm I hope this gave you some ideas. Good luck -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Hello, > > ?? Change my virtual port to ttySXX worked fine... > > ?? But now, im having another problem... > > ? I dont know why, but the virtual port is never calling the SerialEvent in > the SerialPortEventListenner... using the real Serial port, works fine. But > it doesnt work with the virtual port... > > > ?? Somebody have an idea?? Pleasse! > > Thank you!! > Leandro Guimar?es > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman wrote: >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports >> so: >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> the order give (I don't know whether this is a guaranteed behavior or just >> the way it happens to be). >> >> Jim >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >>> >>> Hi, >>> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >>> ? ?tcp:192.168.102.41:54321 >>> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >>> ? ?any terminal. But i can't access this port via RXTX. The >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >>> >>> ? ? ? Please guys, could you help me about that? >>> >>> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >>> >>> Try to change name of the virtual port. >>> >>> I suppose you are using Linux, so: >>> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >>> prefixes for the Linux com ports. >>> Add your prefix there or change your VCP name to match to any predefined >>> prefix there. >>> >>> Regards >>> Mariusz >>> >>> >>> >>> ? ?Thank you very much! >>> ? ?Leandro Guimar?es >>> >>> >>> ? ?_______________________________________________ >>> ? ?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 >> >> -- >> Jim Redman >> (505) 662 5156 x85 >> http://www.ergotech.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From leo.guimaraes at gmail.com Mon Jun 21 14:56:15 2010 From: leo.guimaraes at gmail.com (=?ISO-8859-1?Q?Leandro_Guimar=E3es?=) Date: Mon, 21 Jun 2010 17:56:15 -0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Thanks George, Please, do you know what represents a "data available" in RXTX? Wich signal calls the Listener's Notify? Its the last thing that i need to do to finish my project here! Thank you very much! Leandro Guimar?es 2010/6/21 George H > Hi, > > This might be because it is a virtual port. > I used to do testing on usb/serial port and there were some "signals" > it would not send me that a real serial port would. > Try to see what signals your serial port sends you that the virtual > port doesn't. I think there are some serial port sniffers out there > where you can intercept the signals. Also would do good if you look at > some technical tutorials on how serial port signals work. > > A good site which I read over many times to try to understand why > things are the way they are is http://www.arcelect.com/rs232.htm > > I hope this gave you some ideas. > Good luck > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Hello, > > > > Change my virtual port to ttySXX worked fine... > > > > But now, im having another problem... > > > > I dont know why, but the virtual port is never calling the SerialEvent > in > > the SerialPortEventListenner... using the real Serial port, works fine. > But > > it doesnt work with the virtual port... > > > > > > Somebody have an idea?? Pleasse! > > > > Thank you!! > > Leandro Guimar?es > > > > > > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > wrote: > >> > >> You can also set the property gnu.io.rxtx.SerialPorts to a list of ports > >> so: > >> > >> > >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> > >> or whatever you need for the virtual port. The ports will enumerate in > >> the order give (I don't know whether this is a guaranteed behavior or > just > >> the way it happens to be). > >> > >> Jim > >> > >> > >> > >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >>> > >>> Hi, > >>> > >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >>> tcp:192.168.102.41:54321 > >>> > >>> its working fine for me, accessing the virtual port via CuteCom or > >>> any terminal. But i can't access this port via RXTX. The > >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >>> > >>> Please guys, could you help me about that? > >>> > >>> > >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >>> > >>> Try to change name of the virtual port. > >>> > >>> I suppose you are using Linux, so: > >>> > >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >>> prefixes for the Linux com ports. > >>> Add your prefix there or change your VCP name to match to any > predefined > >>> prefix there. > >>> > >>> Regards > >>> Mariusz > >>> > >>> > >>> > >>> Thank you very much! > >>> Leandro Guimar?es > >>> > >>> > >>> _______________________________________________ > >>> 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 > >> > >> -- > >> Jim Redman > >> (505) 662 5156 x85 > >> http://www.ergotech.com > >> _______________________________________________ > >> 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 george.dma at gmail.com Mon Jun 21 22:51:50 2010 From: george.dma at gmail.com (George H) Date: Tue, 22 Jun 2010 07:51:50 +0300 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Did you read the site I posted? If you did you would have figured out which pin signal on the RS232 interface most likely triggers the data available event. It might be pin 2 and it might be pin 3, depends what kind of serial port you have and the cable. Plus i'm no expert on on RS-232 interfaces, I just know that if I have my hardware in front of me, and the source code of rxtx and a rs-232 specifications sheet then I can debug the problem and find out. This is what I believe you should do to get started to find out the "what, where and why" of your problem. -- George H george.dma at gmail.com 2010/6/21 Leandro Guimar?es : > Thanks George, > > ?? Please, do you know what represents a "data available" in RXTX? Wich > signal calls the Listener's Notify? > > ?? Its the last thing that i need to do to finish my project here! > > Thank you very much! > > Leandro Guimar?es > > > 2010/6/21 George H >> >> Hi, >> >> This might be because it is a virtual port. >> I used to do testing on usb/serial port and there were some "signals" >> it would not send me that a real serial port would. >> Try to see what signals your serial port sends you that the virtual >> port doesn't. I think there are some serial port sniffers out there >> where you can intercept the signals. Also would do good if you look at >> some technical tutorials on how serial port signals work. >> >> A good site which I read over many times to try to understand why >> things are the way they are is http://www.arcelect.com/rs232.htm >> >> I hope this gave you some ideas. >> Good luck >> -- >> George H >> george.dma at gmail.com >> >> >> >> 2010/6/21 Leandro Guimar?es : >> > Hello, >> > >> > ?? Change my virtual port to ttySXX worked fine... >> > >> > ?? But now, im having another problem... >> > >> > ? I dont know why, but the virtual port is never calling the SerialEvent >> > in >> > the SerialPortEventListenner... using the real Serial port, works fine. >> > But >> > it doesnt work with the virtual port... >> > >> > >> > ?? Somebody have an idea?? Pleasse! >> > >> > Thank you!! >> > Leandro Guimar?es >> > >> > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman >> > wrote: >> >> >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of >> >> ports >> >> so: >> >> >> >> >> >> >> >> -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 >> >> >> >> or whatever you need for the virtual port. ?The ports will enumerate in >> >> the order give (I don't know whether this is a guaranteed behavior or >> >> just >> >> the way it happens to be). >> >> >> >> Jim >> >> >> >> >> >> >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: >> >>> >> >>> Hi, >> >>> >> >>> ? ? ?In server machine: ?socat pty,link=$HOME/dev/vmodem0,waitslave >> >>> ? ?tcp:192.168.102.41:54321 >> >>> >> >>> ? ?its working fine for me, accessing the virtual port via CuteCom or >> >>> ? ?any terminal. But i can't access this port via RXTX. The >> >>> ? ?getPortIdentifiers() method returns only the /dev/ttyS0 port. >> >>> >> >>> ? ? ? Please guys, could you help me about that? >> >>> >> >>> >> >>> ?In client machine: socat tcp-l:54321,reuseaddr,fork >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock >> >>> >> >>> Try to change name of the virtual port. >> >>> >> >>> I suppose you are using Linux, so: >> >>> >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid >> >>> prefixes for the Linux com ports. >> >>> Add your prefix there or change your VCP name to match to any >> >>> predefined >> >>> prefix there. >> >>> >> >>> Regards >> >>> Mariusz >> >>> >> >>> >> >>> >> >>> ? ?Thank you very much! >> >>> ? ?Leandro Guimar?es >> >>> >> >>> >> >>> ? ?_______________________________________________ >> >>> ? ?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 >> >> >> >> -- >> >> Jim Redman >> >> (505) 662 5156 x85 >> >> http://www.ergotech.com >> >> _______________________________________________ >> >> Rxtx mailing list >> >> Rxtx at qbang.org >> >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > >> > _______________________________________________ >> > Rxtx mailing list >> > Rxtx at qbang.org >> > http://mailman.qbang.org/mailman/listinfo/rxtx >> > >> > > > From mariusz.dec at gmail.com Tue Jun 22 05:32:01 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 22 Jun 2010 13:32:01 +0200 Subject: [Rxtx] Virtual Port with RXTX In-Reply-To: References: <4C1CCE1A.90201@ergotech.com> Message-ID: Hi, I am working with virtual ports only. Because of some problems with events I have changed whole idea. I did a thread in Java which is looking for port data in pool. If data comes in, I parse it and than generate an Java exception for the application. This works very good from several months and has an advantage more - is faster than events services. I have published many times an example code. Look for 2009'november thread "RXTX close() problem solved". In this example you can set Exception generation in read thread. There is a lot of "try-catch" loops which prevents system while you disconnect USB as well. For me works very good in Mac/Linux and Windows. Regards Mariusz 2010/6/22 George H > Did you read the site I posted? If you did you would have figured out > which pin signal on the RS232 interface most likely triggers the data > available event. > It might be pin 2 and it might be pin 3, depends what kind of serial > port you have and the cable. > > Plus i'm no expert on on RS-232 interfaces, I just know that if I have > my hardware in front of me, and the source code of rxtx and a rs-232 > specifications sheet then I can debug the problem and find out. This > is what I believe you should do to get started to find out the "what, > where and why" of your problem. > -- > George H > george.dma at gmail.com > > > > 2010/6/21 Leandro Guimar?es : > > Thanks George, > > > > Please, do you know what represents a "data available" in RXTX? Wich > > signal calls the Listener's Notify? > > > > Its the last thing that i need to do to finish my project here! > > > > Thank you very much! > > > > Leandro Guimar?es > > > > > > 2010/6/21 George H > >> > >> Hi, > >> > >> This might be because it is a virtual port. > >> I used to do testing on usb/serial port and there were some "signals" > >> it would not send me that a real serial port would. > >> Try to see what signals your serial port sends you that the virtual > >> port doesn't. I think there are some serial port sniffers out there > >> where you can intercept the signals. Also would do good if you look at > >> some technical tutorials on how serial port signals work. > >> > >> A good site which I read over many times to try to understand why > >> things are the way they are is http://www.arcelect.com/rs232.htm > >> > >> I hope this gave you some ideas. > >> Good luck > >> -- > >> George H > >> george.dma at gmail.com > >> > >> > >> > >> 2010/6/21 Leandro Guimar?es : > >> > Hello, > >> > > >> > Change my virtual port to ttySXX worked fine... > >> > > >> > But now, im having another problem... > >> > > >> > I dont know why, but the virtual port is never calling the > SerialEvent > >> > in > >> > the SerialPortEventListenner... using the real Serial port, works > fine. > >> > But > >> > it doesnt work with the virtual port... > >> > > >> > > >> > Somebody have an idea?? Pleasse! > >> > > >> > Thank you!! > >> > Leandro Guimar?es > >> > > >> > > >> > On Sat, Jun 19, 2010 at 11:03 AM, Jim Redman > >> > wrote: > >> >> > >> >> You can also set the property gnu.io.rxtx.SerialPorts to a list of > >> >> ports > >> >> so: > >> >> > >> >> > >> >> > >> >> > -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3 > >> >> > >> >> or whatever you need for the virtual port. The ports will enumerate > in > >> >> the order give (I don't know whether this is a guaranteed behavior or > >> >> just > >> >> the way it happens to be). > >> >> > >> >> Jim > >> >> > >> >> > >> >> > >> >> On 06/18/2010 11:43 PM, Mariusz Dec wrote: > >> >>> > >> >>> Hi, > >> >>> > >> >>> In server machine: socat pty,link=$HOME/dev/vmodem0,waitslave > >> >>> tcp:192.168.102.41:54321 > >> >>> > >> >>> its working fine for me, accessing the virtual port via CuteCom > or > >> >>> any terminal. But i can't access this port via RXTX. The > >> >>> getPortIdentifiers() method returns only the /dev/ttyS0 port. > >> >>> > >> >>> Please guys, could you help me about that? > >> >>> > >> >>> > >> >>> In client machine: socat tcp-l:54321,reuseaddr,fork > >> >>> file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock > >> >>> > >> >>> Try to change name of the virtual port. > >> >>> > >> >>> I suppose you are using Linux, so: > >> >>> > >> >>> In RXTX 2.2pre sources RXTXCommDriver, lines 590+ - there are valid > >> >>> prefixes for the Linux com ports. > >> >>> Add your prefix there or change your VCP name to match to any > >> >>> predefined > >> >>> prefix there. > >> >>> > >> >>> Regards > >> >>> Mariusz > >> >>> > >> >>> > >> >>> > >> >>> Thank you very much! > >> >>> Leandro Guimar?es > >> >>> > >> >>> > >> >>> _______________________________________________ > >> >>> 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 > >> >> > >> >> -- > >> >> Jim Redman > >> >> (505) 662 5156 x85 > >> >> http://www.ergotech.com > >> >> _______________________________________________ > >> >> 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 > >> > > >> > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Tue Jun 22 07:20:17 2010 From: showard314 at gmail.com (Scott Howard) Date: Tue, 22 Jun 2010 09:20:17 -0400 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails Message-ID: This is forwarded from: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472053 by Jan Niehusmann I tried putting this on the bug tracker but I couldn't get access In the static initializer of gnu.io.RXTXPort, an exception when initializing the static variable 'z' is silently discarded: try { z = new Zystem(); } catch ( Exception e ) {}; This leads to NullPointerExceptions later, which are difficult to debug as the original exception is lost. I did change the code to try { z = new Zystem(); } catch ( Exception e ) { throw new Error(e.toString()); }; for debugging. Probably a more specific exception would be more appropriate, but the point is that leaving z undefined without reporting an error makes debugging unnecessarily difficult. Thanks. From g3vbv at blueyonder.co.uk Tue Jun 22 19:20:11 2010 From: g3vbv at blueyonder.co.uk (Sid Boyce) Date: Wed, 23 Jun 2010 02:20:11 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar Message-ID: <4C21614B.3060504@blueyonder.co.uk> I am using openSUSE 11.3 RC1. "rfcomm -a" lists no devices From dmesg =========== [288811.093151] usb 2-4.4.2: new full speed USB device using ehci_hcd and address 16 [288811.207421] usb 2-4.4.2: New USB device found, idVendor=0403, idProduct=6001 [288811.207431] usb 2-4.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [288811.207438] usb 2-4.4.2: Product: FT232R USB UART [288811.207443] usb 2-4.4.2: Manufacturer: FTDI [288811.207447] usb 2-4.4.2: SerialNumber: A100efz7 [288811.210509] ftdi_sio 2-4.4.2:1.0: FTDI USB Serial Device converter detected [288811.210534] usb 2-4.4.2: Detected FT232RL [288811.210536] usb 2-4.4.2: Number of endpoints 2 [288811.210538] usb 2-4.4.2: Endpoint 1 MaxPacketSize 64 [288811.210540] usb 2-4.4.2: Endpoint 2 MaxPacketSize 64 [288811.210541] usb 2-4.4.2: Setting MaxPacketSize 64 [288811.210822] usb 2-4.4.2: FTDI USB Serial Device converter now attached to ttyUSB1 Package built and installed OK in /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/amd64, it also installed /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/RXTXcomm.jar slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar RXTXcomm.jar Failed to load Main-Class manifest attribute from RXTXcomm.jar # rpm -qa |grep java java-1_6_0-sun-1.6.0.u20-1.15.x86_64 gcc44-java-4.4.2_20100116-1.2.x86_64 netbeans-javaparser-6.8-1.1.noarch gcc45-java-4.5.0_20100604-1.1.x86_64 ant-javadoc-1.7.1-11.1.noarch javahelp2-2.0.05-6.28.noarch gcc43-java-4.3.4_20091019-2.25.x86_64 gcc-java-4.5-5.2.x86_64 java-ca-certificates-1-5.1.noarch java-1_6_0-sun-devel-1.6.0.u20-1.15.x86_64 lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> echo $JAVA_HOME /usr/lib64/jvm/java-1.6.0-sun-1.6.0 > l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/amd64/ total 6440 drwxr-xr-x 8 root root 4096 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ drwxr-xr-x 2 root root 23 2010-06-18 16:41 headless/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 jli/ -rw-r--r-- 1 root root 652 2010-04-12 22:00 jvm.cfg -rwxr-xr-x 1 root root 15836 2010-04-12 22:25 libattach.so* -rwxr-xr-x 1 root root 757091 2010-04-12 22:25 libawt.so* -rwxr-xr-x 1 root root 413267 2010-04-12 22:25 libcmm.so* -rwxr-xr-x 1 root root 217736 2010-04-12 22:25 libdcpr.so* -rwxr-xr-x 1 root root 120029 2010-04-12 22:30 libdeploy.so* -rwxr-xr-x 1 root root 21670 2010-04-12 22:25 libdt_socket.so* -rwxr-xr-x 1 root root 692649 2010-04-12 22:25 libfontmanager.so* -rwxr-xr-x 1 root root 237073 2010-04-12 22:25 libhprof.so* -rwxr-xr-x 1 root root 50085 2010-04-12 22:25 libinstrument.so* -rwxr-xr-x 1 root root 27244 2010-04-12 22:25 libioser12.so* -rwxr-xr-x 1 root root 46723 2010-04-12 22:25 libj2gss.so* -rwxr-xr-x 1 root root 14272 2010-04-12 22:25 libj2pcsc.so* -rwxr-xr-x 1 root root 78017 2010-04-12 22:25 libj2pkcs11.so* -rwxr-xr-x 1 root root 7980 2010-04-12 22:25 libjaas_unix.so* -rwxr-xr-x 1 root root 28919 2010-04-12 22:25 libjava_crw_demo.so* -rwxr-xr-x 1 root root 231135 2010-04-12 22:25 libjava.so* -rwxr-xr-x 1 root root 7099 2010-04-12 22:25 libjawt.so* -rwxr-xr-x 1 root root 293725 2010-04-12 22:25 libjdwp.so* -rwxr-xr-x 1 root root 224947 2010-04-12 22:25 libjpeg.so* -rwxr-xr-x 1 root root 10964 2010-04-12 22:25 libjsig.so* -rwxr-xr-x 1 root root 260521 2010-04-12 22:25 libjsound.so* -rwxr-xr-x 1 root root 37449 2010-04-12 22:25 libmanagement.so* -rwxr-xr-x 1 root root 734280 2010-04-12 22:25 libmlib_image.so* -rwxr-xr-x 1 root root 6667 2010-04-12 22:25 libnative_chmod_g.so* -rwxr-xr-x 1 root root 6571 2010-04-12 22:25 libnative_chmod.so* -rwxr-xr-x 1 root root 111945 2010-04-12 22:25 libnet.so* -rwxr-xr-x 1 root root 43716 2010-04-12 22:25 libnio.so* -rwxr-xr-x 1 root root 15651 2010-04-12 22:25 libnpt.so* -rwxr-xr-x 1 root root 6420 2010-04-12 22:25 librmi.so* -rwxr-xr-x 1 root root 77907 2010-06-18 16:56 librxtxI2C-2.2pre1.so* -rw-r--r-- 1 root root 97530 2010-06-18 16:56 librxtxI2C.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxI2C.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxI2C.so -> librxtxI2C-2.2pre1.so* -rwxr-xr-x 1 root root 55253 2010-06-18 16:56 librxtxParallel-2.2pre1.so* -rw-r--r-- 1 root root 66164 2010-06-18 16:56 librxtxParallel.a -rwxr-xr-x 1 root root 1035 2010-06-18 16:56 librxtxParallel.la* lrwxrwxrwx 1 root root 26 2010-06-18 16:56 librxtxParallel.so -> librxtxParallel-2.2pre1.so* -rwxr-xr-x 1 root root 79049 2010-06-18 16:56 librxtxRaw-2.2pre1.so* -rw-r--r-- 1 root root 100218 2010-06-18 16:56 librxtxRaw.a -rwxr-xr-x 1 root root 1000 2010-06-18 16:56 librxtxRaw.la* lrwxrwxrwx 1 root root 21 2010-06-18 16:56 librxtxRaw.so -> librxtxRaw-2.2pre1.so* -rwxr-xr-x 1 root root 78134 2010-06-18 16:56 librxtxRS485-2.2pre1.so* -rw-r--r-- 1 root root 98662 2010-06-18 16:56 librxtxRS485.a -rwxr-xr-x 1 root root 1014 2010-06-18 16:56 librxtxRS485.la* lrwxrwxrwx 1 root root 23 2010-06-18 16:56 librxtxRS485.so -> librxtxRS485-2.2pre1.so* -rwxr-xr-x 1 root root 192681 2010-06-18 16:56 librxtxSerial-2.2pre1.so* -rw-r--r-- 1 root root 267524 2010-06-18 16:56 librxtxSerial.a -rwxr-xr-x 1 root root 1021 2010-06-18 16:56 librxtxSerial.la* lrwxrwxrwx 1 root root 24 2010-06-18 16:56 librxtxSerial.so -> librxtxSerial-2.2pre1.so* -rwxr-xr-x 1 root root 48036 2010-04-12 22:25 libsaproc.so* -rwxr-xr-x 1 root root 294575 2010-04-12 22:25 libsplashscreen.so* -rwxr-xr-x 1 root root 134786 2010-04-12 22:25 libunpack.so* -rwxr-xr-x 1 root root 66292 2010-04-12 22:25 libverify.so* -rwxr-xr-x 1 root root 91191 2010-04-12 22:25 libzip.so* drwxr-xr-x 2 root root 23 2010-06-18 16:41 motif21/ drwxr-xr-x 2 root root 22 2010-06-18 16:41 native_threads/ drwxr-xr-x 2 root root 56 2010-06-18 16:41 server/ -rw------- 1 root root 0 2010-06-18 16:53 stC2p3qT -rw------- 1 root root 0 2010-06-18 16:53 stJpl8lW -rw------- 1 root root 0 2010-06-18 16:53 stnb1qWY -rw------- 1 root root 0 2010-06-18 16:53 stYjTgRS -rw------- 1 root root 0 2010-06-18 16:53 stZA8aVV drwxr-xr-x 2 root root 23 2010-06-18 16:41 xawt/ lancelot at slipstream:~/ftp/Jun10/RXTX/rxtx-devel> l /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/lib/ext/ total 1300 drwxr-xr-x 2 root root 125 2010-06-18 16:56 ./ drwxr-xr-x 19 root root 4096 2010-06-18 16:53 ../ -rw-r--r-- 1 root root 8239 2010-04-12 22:08 dnsns.jar -rw-r--r-- 1 root root 842216 2010-06-10 12:45 localedata.jar -rw-r--r-- 1 root root 429 2010-04-12 22:23 meta-index -rwxr-xr-x 1 root root 61389 2010-06-18 16:56 RXTXcomm.jar* -rw-r--r-- 1 root root 170239 2010-04-12 21:58 sunjce_provider.jar -rw-r--r-- 1 root root 230608 2010-04-12 22:08 sunpkcs11.jar Help appreciated. 73 ... Sid. -- Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support Specialist, Cricket Coach Microsoft Windows Free Zone - Linux used for all Computing Tasks From Kustaa.Nyholm at planmeca.com Tue Jun 22 23:38:46 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 08:38:46 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: Message-ID: > I did change the code to > try { > z = new Zystem(); > } catch ( Exception e ) { > throw new Error(e.toString()); > }; Is there a reason why this could/should not be: > try { > z = new Zystem(); > } catch ( Throwable e ) { > e.printStackTrace(System.err); > }; From msemtd at googlemail.com Wed Jun 23 02:14:25 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:14:25 +0100 Subject: [Rxtx] mini VNA Pro - Failed to load Main-Class manifest attribute from RXTXcomm.jar In-Reply-To: <4C21614B.3060504@blueyonder.co.uk> References: <4C21614B.3060504@blueyonder.co.uk> Message-ID: On 23 June 2010 02:20, Sid Boyce wrote: > slipstream:/home/lancelot/ftp/Jun10/RXTX/rxtx-devel # java -jar > RXTXcomm.jar > Failed to load Main-Class manifest attribute from > RXTXcomm.jar > Help appreciated. > 73 ... Sid. Well Sid, it's pretty obvious to me: you're trying to launch a jar that doesn't contain a main(). What exactly are you trying to achieve by running "java -jar RXTXcomm.jar"? Regards, Michael Erskine. From msemtd at googlemail.com Wed Jun 23 02:17:11 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 23 Jun 2010 09:17:11 +0100 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: On 23 June 2010 06:38, Kustaa Nyholm wrote: > >> I did change the code to >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >> ? ? ? ? ? ? ? ?}; > > Is there a reason why this could/should not be: > > >> ? ? ? ? ? ? ? ?try { >> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >> ? ? ? ? ? ? ? ?}; Or even just let the exception bubble up and kill whatever thread caused the class to load :) I vote for the removal of Zystem BTW! Regards, Michael Erskine. From george.dma at gmail.com Wed Jun 23 02:34:07 2010 From: george.dma at gmail.com (George H) Date: Wed, 23 Jun 2010 11:34:07 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: -- George H george.dma at gmail.com On Wed, Jun 23, 2010 at 11:17 AM, Michael Erskine wrote: > On 23 June 2010 06:38, Kustaa Nyholm wrote: >> >>> I did change the code to >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Exception e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?throw new Error(e.toString()); >>> ? ? ? ? ? ? ? ?}; >> >> Is there a reason why this could/should not be: >> >> >>> ? ? ? ? ? ? ? ?try { >>> ? ? ? ? ? ? ? ? ? ? ? ?z = new Zystem(); >>> ? ? ? ? ? ? ? ?} catch ( Throwable e ) { >>> ? ? ? ? ? ? ? ? ? ? ? ?e.printStackTrace(System.err); >>> ? ? ? ? ? ? ? ?}; > > Or even just let the exception bubble up and kill whatever thread > caused the class to load :) > > I vote for the removal of Zystem BTW! > > Regards, > Michael Erskine. I would prefer that an exception is thrown rather than the stack trace be printed. If anyone is using loggers then it would be useful to catch the exception and log it, rather than let it come out in the error stream where no one might look. From Steffen.DETTMER at ingenico.com Wed Jun 23 03:28:45 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 11:28:45 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: Message-ID: <20100623092844.GF20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 08:38 +0300: > > I did change the code to > > try { > > z = new Zystem(); > > } catch ( Exception e ) { > > throw new Error(e.toString()); > > }; > > Is there a reason why this could/should not be: > > > try { > > z = new Zystem(); > > } catch ( Throwable e ) { > > e.printStackTrace(System.err); > > }; Is this intentionally not throwing the exception? Well, then it still would be discarded (althrough not neccesarily silently :)). BTW, I don't think System.err is a good idea. It is `statically initialized'? I think then this means it is unclear who the caller is and who could catch this exception. Wouldn't it be better to store the exception in a member and throw it when needing Zystem (e.g. in new or open)? 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 Kustaa.Nyholm at planmeca.com Wed Jun 23 03:55:30 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 23 Jun 2010 12:55:30 +0300 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: >> Is there a reason why this could/should not be: >> >>> try { >>> z = new Zystem(); >>> } catch ( Throwable e ) { >>> e.printStackTrace(System.err); >>> }; > > Is this intentionally not throwing the exception? Well, no, just a hasty reply from my part. > still would be discarded (althrough not neccesarily silently :)). > BTW, I don't think System.err is a good idea. > > It is `statically initialized'? I think then this means it is > unclear who the caller is and who could catch this exception. > Even so re-throwing the exception would make sense so that the application developer has a chance to handle this in whichever way they want. Of course logically this should not then print the stacktrace because that is the responsibility of the application developer. But so many do not handle these cases sensibly so from the application user point of view it is nice to have something on the console to aid in trouble shooting. Have not checked the context in which this happens so that might influence my opinion. > Wouldn't it be better to store the exception in a member and > throw it when needing Zystem (e.g. in new or open) I'm of the fail-fast school of thought so I think it should be reported and re-thrown as it happens, not later. br Kusti From pietro.galassi at gmail.com Wed Jun 23 05:59:29 2010 From: pietro.galassi at gmail.com (Pietro Galassi) Date: Wed, 23 Jun 2010 13:59:29 +0200 Subject: [Rxtx] Resource temporarily unavaible on writeByte() Message-ID: Hi, i have successfully installe RXTX 64bit version from UBUNTO repository. I wrote a simple test program and it shows i have 3 ports avaible on my system: /dev/ttyS1 - Serial /dev/ttyS0 - Serial /dev/lp0 - Parallel but as soon as i try to "writeByte" any data on the parallel port it always gives me: java.io.IOException: Resource temporarily unavaible on writeByte() My simple code is: ... outputStream = parallelPort.getOutputStream() ; System.out.println("Write..."); outputStream.write(88); outputStream.flush(); outputStream.close(); ... int mode = parallelPort.getMode(); gives always 0. Anyone can help pls ? Thanks a lot, Pietro Galassi -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Jun 23 10:35:37 2010 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 23 Jun 2010 18:35:37 +0200 Subject: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails In-Reply-To: References: <20100623092844.GF20640@elberon.bln.de.ingenico.com> Message-ID: <20100623163536.GI20640@elberon.bln.de.ingenico.com> * Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 12:55 +0300: > > Wouldn't it be better to store the exception in a member and > > throw it when needing Zystem (e.g. in new or open) > > I'm of the fail-fast school of thought so I think it should be > reported and re-thrown as it happens, not later. Ahh yes, I agree, in general it is much better to fail quick, loud and verbosely, right! However, if this is a static { } block, AFAIK it is not defined when it will be executed (Before application start? Or later, when loading the class later? Or when using it first time?). If the exception would be thrown before main() is called, I think it is difficult to catch it. I think some general global hook must be used to do so. Simpler to handle, if it is thrown when invocating some function, then it can be caught by try { } catch. (or am I wrong or outdated?) 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 rbreznak at neuronrobotics.com Wed Jun 23 11:46:21 2010 From: rbreznak at neuronrobotics.com (Breznak, Robert) Date: Wed, 23 Jun 2010 13:46:21 -0400 Subject: [Rxtx] Bundling native libraries Message-ID: Hello, I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. Has anyone had experience in doing this? Bob ------------------- Bob Breznak 1-877-474-6038 ext#701 www.neuronrobotics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Wed Jun 23 18:26:17 2010 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 23 Jun 2010 17:26:17 -0700 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Whoops, forgot to copy this to the RXTX list ... ---------- Forwarded message ---------- From: Brian Schlining Date: Wed, Jun 23, 2010 at 11:11 Subject: Re: [Rxtx] Bundling native libraries To: "Breznak, Robert" Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a > one jar. Its to the point where I have an Ant script that pulls all of the > jars together, but I haven't been able to get the native libraries to work; > They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the > user to get and use. They don't need to worry about external dependencies > and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinzenz.weber at techforce.at Thu Jun 24 00:37:35 2010 From: vinzenz.weber at techforce.at (Vinzenz-Emanuel Weber) Date: Thu, 24 Jun 2010 08:37:35 +0200 Subject: [Rxtx] Fwd: Bundling native libraries In-Reply-To: References: Message-ID: Here is a snippet from my ant file. I actually unjar the rxtx jar file and add my own classes to it for Mac and WIndows. The snippet below is actually for Mac but just for your info I am using nsis and launch4j to create an exectuable for windows. I also copy the rxtx libs to the root folder of my application: On 24.06.2010, at 02:26, Brian Schlining wrote: > Whoops, forgot to copy this to the RXTX list ... > > ---------- Forwarded message ---------- > From: Brian Schlining > Date: Wed, Jun 23, 2010 at 11:11 > Subject: Re: [Rxtx] Bundling native libraries > To: "Breznak, Robert" > > > Yes, Take a look at http://www.google.com/codesearch/p?hl=en#C1SUqISNcH0/trunk/src/main/java/org/mbari/nativelib/Native.java&q=Native%20package:http://mbarix4j%5C.googlecode%5C.com&sa=N&cd=1&ct=rc > > On Wed, Jun 23, 2010 at 10:46, Breznak, Robert wrote: > Hello, > I am working on a project that I'd like to have the whole thing roll into a one jar. Its to the point where I have an Ant script that pulls all of the jars together, but I haven't been able to get the native libraries to work; They need to still sit outside of the jar to work. > > The reason for getting everything into one jar is to make it easier for the user to get and use. They don't need to worry about external dependencies and installation / updating is a single point of change. > > Has anyone had experience in doing this? > > Bob > ------------------- > Bob Breznak > 1-877-474-6038 ext#701 > www.neuronrobotics.com > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > bschlining at gmail.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- DI (FH) Vinzenz-Emanuel Weber Software Engineer software for every case web / pc / embedded / mobile +436607675979 Wiedner G?rtel 26 A-1040 Wien http://www.techforce.at -------------- next part -------------- An HTML attachment was scrubbed... URL: From djjames at drs-ssi.com Thu Jun 24 11:29:21 2010 From: djjames at drs-ssi.com (James, David (DJ) (SA-1)) Date: Thu, 24 Jun 2010 12:29:21 -0500 Subject: [Rxtx] Port to RS422? Message-ID: Has anyone tried porting RxTx to RS422? If not, where is all the C code for the other implementations so that I can give it a shot? Thanks! David James DRS SSI DRS Technologies, a Finmeccanica Company 201 Evans Lane St. Louis MO 63121 314-553-4528 djjames at drs-ssi.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jun 24 12:18:10 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Thu, 24 Jun 2010 20:18:10 +0200 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, RXTX of course works. RS422, RS485 differs from RS232 on hardware level only. So, because RXTX works with RS232 will works wit RS422 as well. Only difference is that RS422 may will be faster - but it depends of actual hardware. RXTX allows using any speed available in driver/hw. -->> Google & Wiki have a tons of answers about differences.... Regards Mariusz 2010/6/24 James, David (DJ) (SA-1) > Has anyone tried porting RxTx to RS422? > > > > If not, where is all the C code for the other implementations so that I can > give it a shot? > > > > Thanks! > > > > David James > > DRS SSI > > DRS Technologies, a Finmeccanica Company > > 201 Evans Lane > > St. Louis MO 63121 > > 314-553-4528 > > djjames at drs-ssi.com > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Thu Jun 24 12:22:15 2010 From: showard314 at gmail.com (Scott Howard) Date: Thu, 24 Jun 2010 14:22:15 -0400 Subject: [Rxtx] Port to RS422? In-Reply-To: References: Message-ID: Hi, On Thu, Jun 24, 2010 at 1:29 PM, James, David (DJ) (SA-1) wrote: > Has anyone tried porting RxTx to RS422? Don't know for sure but . . . > If not, where is all the C code for the other implementations so that I can > give it a shot? http://rxtx.qbang.org/wiki/index.ph